-->
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: fetch join with temporary table in batches?
PostPosted: Fri Aug 14, 2009 4:54 pm 
Newbie

Joined: Wed Aug 12, 2009 1:46 pm
Posts: 7
I need to process a large number of Person objects, each person object has a few lazy relations that I need to load in all at once.
I have created a batched temporary table with the Person ID's that I want:
Code:
PersonBatch {
   Long personID;
   int batchID;
}

I want to load in entire the object web for each Person in batches (so hibernate does not run out of memory).
Code:
Select P From Person P, PersonBatch T Where T.personID = P.id AND T.batchID = ?


This works fine, but I want to fetch join the optional relations that P might have. I'm trying to do:
Code:
Select P From Person P inner join PersonBatch T Where T.personID = P.id left fetch join P.friend left fetch join P.extraData


I can't seem to figure out the HQL that makes this work, anyone see a way to do it?


Top
 Profile  
 
 Post subject: Re: fetch join with temporary table in batches?
PostPosted: Fri Aug 14, 2009 11:25 pm 
Newbie

Joined: Wed Aug 12, 2009 1:46 pm
Posts: 7
Finally figured out the HQL, but learned you can only load 1 bag per collection fetch query.


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.