NHibernate QueryOver , JoinAlias problem
I'm pretty new to Nhibernate and QueryOver techniques. Peace if I'm asking som开发者_JAVA百科e basic things ;)
My hbm looks like this,
<class
name="ElementLogic.Wms.Common.Core.Orderline,Domain"
table="ORDERLINE"
lazy="true"
dynamic-insert="true"
dynamic-update="true"
>
<many-to-one
name = "Product"
class = "ElementLogic.Wms.Common.Core.Product, Domain"
access="field.camelcase-underscore"
cascade = "save-update"
fetch="select"
insert = "false"
update = "false"
property-ref = "ExtProductId">
<column name="EXTPRODUCTID" />
</many-to-one>
<property type="int" name="UserId" column="[USERID]" />
</class>
I'm trying to join entities as follows , which works fine
query.JoinAlias(() => _orderLineAlias.Product, () => _productAlias);
I just want to know if I can join the User entity in the same way, without having to alter the UserId feild to a many-to-one relationship. Is it possible to acheive? if so pls be patient to explain :)
/BB
There seems to be no way around this problem. So I went ahead and added the mapping User to the OrderLine. ;)
/BB
精彩评论