-->
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: Fetch mode for recursive relationship
PostPosted: Sun Feb 08, 2004 8:58 pm 
Newbie

Joined: Thu Jan 29, 2004 3:52 pm
Posts: 16
Hi,

Runtime fetching strategy sounds like a very interesting feature. So I played with it. I have a recursive relationship (parent/children) for entity A mapped using:
Code:
<set name="children" lazy="true" inverse="true" cascade="save-update">
<key column="parent_id" />
<one-to-many class="A" />
</set>
<many-to-one name="parent" class="A" column="parent_id" />


I have a following scenario. Load root of the tree and serialize it to the other VM. If I set lazy to false and load the root then the whole tree of A objects is loaded. That is what I expected. If I set lazy to true, children don't get loaded and I get Exception while accessing them. Excellent.

Now if I set the runtime fetch parameter of the Criteria to be eager and keep the lazy to be true only the root and its children are loaded while other nodes deeper in the tree are not loaded.

How can we specify using Criteria API that indeed we want the whole tree loaded?

Regards,
Vladimir


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2004 5:56 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I don't think this is doable. Add a feature to JIRA.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2004 9:13 am 
Newbie

Joined: Thu Jan 29, 2004 3:52 pm
Posts: 16
Hi,

I've submitted it. Hopefully it is clear enough.

http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-697

Regards,
Vladimir


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.