views:

261

answers:

1

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 setting 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?

A: 

It appears that this is a bug that has been fixed in 2.1GA. What version of NHibernate are you using?

Jamie Ide
I've updated to the newest version and it all seems good again.
Chris Meek