-->
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: Delay child selection until collection touched...
PostPosted: Fri Sep 09, 2005 12:20 am 
Newbie

Joined: Wed Aug 31, 2005 9:29 pm
Posts: 14
I have a parent child relationship. I am using a Criteria to select a list of parents. Currently, my database is issued a query with a join between my parent and child tables.

Is it possible to delay the selection of children until I actually touch the Children collection for each parent?

Instead of:

Code:
select *
from parent
left join children ...
where ...


use:

Code:
select *
from parent
where ...


and when I touch the Children collection:

Code:
select *
from child
where parentid = ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 3:00 am 
Newbie

Joined: Wed Aug 31, 2005 9:29 pm
Posts: 14
Nevermind, I've just discovered lazy loading!


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.