-->
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: Hibernate initialize depth
PostPosted: Fri Mar 25, 2011 11:59 pm 
Newbie

Joined: Wed Oct 13, 2010 11:19 am
Posts: 7
If we assume that Cat has a collection of kittens and kitten has a collection of toys and I call

Hibernate.initialize(cat.getKittens());

does that mean the toys collection is also initialized? If so, is there a way to just get kittens without toys?

thanks,
Peter


Top
 Profile  
 
 Post subject: Re: Hibernate initialize depth
PostPosted: Sun Mar 27, 2011 6:45 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
does that mean the toys collection is also initialized?

No.
Read about lazy loading on the reference docs: http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/

_________________
Sanne
http://in.relation.to/


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.