When creating a criteria with a subcriteria the fetchmode is lost or ignored.
eg:
session.CreateCriteria( typeof ( Contact ))
.Add(Expression.Eq("Name", "Bob")
.SetFetchMode("Emails", FetchMode.Eager)
.CreateCriteria("Emails")
.Add(Expression.Eq("EmailAddress","
Bob@hotmail.com"))
.List();
Contact.Email is not initialized resulting in:
'NHibernate.LazyInitializationException' occurred in nhibernate.dll
Reordering criteria does not help eg setting the fetchmode in the sub criteria.
Oz
http://opensource2.atlassian.com/projects/hibernate/browse/HB-918