-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to force Lazy Initialization?
PostPosted: Wed Apr 14, 2004 8:55 pm 
Regular
Regular

Joined: Sun Oct 26, 2003 9:02 pm
Posts: 90
Hi

How can I force Lazy Initialization in a collection after is loaded?. For example:


Object obj = session.load (...);

// Force lazy initialization of collection in object

session.close ();

// Do something with that collection

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 14, 2004 8:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Hibernate.initialize(collection)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:09 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
you can also optimize it by using "left FETCH join" if you retrieve your object by querying

take a look at the doc for "join fetching"


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.