-->
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: Enable temporarily the lazy loading
PostPosted: Mon Dec 10, 2007 10:39 am 
Newbie

Joined: Fri Apr 20, 2007 5:10 pm
Posts: 2
Can I have lazy="false" in my collection mapping, but in some cases, during runtime, set it to lazy="true"?

Or the other way around?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 10, 2007 10:48 am 
Newbie

Joined: Thu Mar 01, 2007 1:37 pm
Posts: 7
Depending on what your reason for doing so is, you can instantiate the items in a lazy collection simply by issuing Collection<t>.Count while the parent object is attached to a session.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 12, 2007 6:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Use SetFetchMode() in the ICriteria interface or "join fetch" in HQL. Have a read of the docs about fetching strategies here:
http://www.hibernate.org/hib_docs/nhibe ... e-fetching

_________________
Karl Chu


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.