I read on the NHibernate changelog of version 3.3 that you can now lazyload one-to-one associations, which was not possible before, I've tried setting up lazy on my association but it still gets eager-loader, how would the mapping be for lazy loaded one-to-one association? I'm using fluentNhibernate.
Since proxies can only be generated if it is guaranteed that there is a target available (since NHibernate can't replace the proxy with null when it's loaded), NHibernate needs to know that your one-to-one association is constrained in the database. This is done with the constrained
attribute on the <one-to-one>
tag.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.