1

I'm using nhibernate to load parent class in a not lazy way and I have many-to-many set of child class that I want to determine in run time rather to load it lazy or not. I'm using .hbm.xml mapping and I tried to change the set "lazy" property after loading the assemblies, is it possible?

1 Answer 1

1

I think the best (only) way is to set lazy=false and then in your HQL use "join fetch" or in criterias use SetFetchMode on a collection that needs to be eagerly retrieved.

Read more here: http://ayende.com/Blog/archive/2006/05/02/CombatingTheSelectN1ProblemInNHibernate.aspx

/Asger

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.