I have a property in one of my models that is linked to a non-key field using property-ref. It always lazy loads even though explicitly set to not do so.
I have other properties in the same class that reference other model objects using the normal method (on their key fields) and these take note of settin开发者_开发技巧g lazy load to false absolutely fine.
<many-to-one class="Company" lazy="false" name="Company" property-ref="Code">
<column name="CompanyCode" />
</many-to-one>
I'm loading the parent model into a list and getting the classic N+1 problem because this field is lazy loading. Is this an issue with property-ref properties or have I missed something?
It appears that this is a bug that has been fixed in 2.1GA. What version of NHibernate are you using?
精彩评论