History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: NH-381
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Sergey Koshcheyev
Reporter: Oz Kologlu
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
NHibernate

FetchMode ignored when using CreateCriteria(..).CreateCriteria(..)

Created: 21/Sep/05 09:58 PM   Updated: 04/Oct/05 06:45 PM
Component/s: Core
Affects Version/s: 1.0-rc1
Fix Version/s: None


 Description  « Hide
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



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Sergey Koshcheyev - 22/Sep/05 03:38 AM
According to Hibernate guys this is correct behavior:
http://opensource2.atlassian.com/projects/hibernate/browse/HB-918