-->
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: Is it possible to set lazy at runtime?
PostPosted: Sun Oct 26, 2003 8:36 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
I want a java method to consult a classe Xpto that has a some Set's.
All these Set's are loaded lazy by default.

The method returns a Xpto instance. But the client can't view one of Xpto's Set's because there loaded lazy and I've already maid the session.close() in the method, giving the "LazyInitializationException".

Is there a way to set lazy="false" on a certain Set (in java code) at runtime so I can view the Set's data?


Please help.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2003 11:09 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Code:
select A as a from a left ouer join fetch a.bs


fetch is the keyword. Only one fetch on collection is allowed by HQL resquest.

See section 9.3 for more details.

_________________
Emmanuel


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.