开发者

NHibernate: Many-to-one IUserType

开发者 https://www.devze.com 2023-04-02 04:04 出处:网络
Following on from this question: NHibernate: Lazy loading of IUserType Seeing as I can\'t lazy load a property or a one-to-one relationship, is there a way I can use an IUserType with a many-to-one?

Following on from this question:

NHibernate: Lazy loading of IUserType

Seeing as I can't lazy load a property or a one-to-one relationship, is there a way I can use an IUserType with a many-to-one? Something like this (which doesn't work):

<many-to开发者_如何学JAVA-one
     name="Client" column="`ClientId`"
     lazy="true"
     type="EmployeeSystem.UserTypes.ClientUserType, EmployeeSystem" />


Looks like NHibernate does not support custom loading (IUserType) for associations (many-to-one, one-to-one etc). As a side note, lazy loading with one-to-one is possible, but again there is no way to put the IUserType hook. I think you were on the right track with lazy properties. Update the original question with the code that shows how you load Employee.

0

精彩评论

暂无评论...
验证码 换一张
取 消