Vasea
Vasea

Reputation: 5333

How to eager load lazy-loading properties/components with NHibernate Criteria API?

I have a lazy-loading property (component) in one of my entity classes. In HQL I can write "fetch all properties" to eagerly load it.

Can I do the same with Criteria API? I tried criteria.SetFetchMode("PropertyName", FetchMode.Eager) but is not working. I am using NHibernate 3.1 GA

Upvotes: 2

Views: 713

Answers (0)

Related Questions