-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: FetchMode.LAZY returns objects for collection anyway?
PostPosted: Mon Jul 18, 2005 4:59 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 2:22 pm
Posts: 27
I've got a pretty simple DAO method that is attempting to retrieve objects without filling in the whole graph for particular fields that contain collections of other objects. So, in my method I set FetchMode.LAZY on the collection fields in question. However, after executing the Criteria list() method, I see that the collections are populated anyway. Is there some other controlling factor that would override my criteria fetch mode?

Here is a code snippet:

session = getHibernateTemplate().getSessionFactory().openSession();
Criteria crit = session.createCriteria(Site.class);
crit.setFetchMode("rooms", FetchMode.LAZY);
List<Site> objects = crit.list();


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 18, 2005 5:20 pm 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
What's the generated SQL?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.