我想通過Retailer.Name對CampaignRetailers進行排序。但零售商是CampaignRetailers上的參考實體。我試過order-by="Retailer.Name"
。這種排序可能嗎?NHibernate:如何通過被引用實體的屬性對集合進行排序
<class name="Campaign" table="Campaign">
<id name="Id">
<generator class="identity"/>
</id>
<set name="CampaignRetailers" table="CampaignRetailers"
cascade="all-delete-orphan" inverse="true" order-by="Retailer.Name">
<key column="CampaignId" not-null="true" />
<one-to-many class="CampaignRetailer" />
</set>
</class>
<class name="CampaignRetailer" table="CampaignRetailers">
<id name="Id">
<generator class="identity"/>
</id>
<many-to-one name="Campaign" column="CampaignId" />
<many-to-one name="Retailer" column="RetailerId" />
</class>