-->
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.  [ 1 post ] 
Author Message
 Post subject: Not lazy collection consisting of lazy-laoded objetcs
PostPosted: Fri Apr 06, 2007 6:17 am 
Newbie

Joined: Wed May 31, 2006 12:58 pm
Posts: 14
Hello everybody, I use Hibernate 2 and I'd have the following question:

In a class mapping I declare a bag-collection which is not indicated to be a lazy one (so, this is a parent object). This collection contains objects of a class, who has a "proxy" attribute in its mapping (and these are child-objects). The colection may also be empty.

When I get a parent object with an HQL query (in which I write nothing about that collection), I get a LazyInitializationException when I try to access the collection's elements later (that is right and it is clear, why it happens - a "proxy" attribute). So, I should specify in my query that all elements of the collection are to initialize when I am fetching the parent object. How can I do it? Should a "LEFT JOIN FETCH" construction work? Seems like JOIN FETCH does not work...


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

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.