-->
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: "Subselect" fetching strategy on nested collections
PostPosted: Mon Oct 01, 2012 6:09 pm 
Newbie

Joined: Mon Oct 01, 2012 5:58 pm
Posts: 1
I have 3 entities and nested collections of them as follows:
Entity A contains collection of B
Entity B contains collection of C

And I need to fetch a list of full object graphs of entity A. When I set fetching strategy to "subselect" both for collection of B and collection of C, actually only collection of B is read via single query. Each collection of C is read via separate query per each entity of type B - the same as if fetching strategy was "select" there.

So I expect the following:
select ... from A
select ... from B where a_id in (select id from A)
select ... from C where b_id in (select id from B where a_id in (select id from A))

But actually get:
select ... from A
select ... from B where a_id in (select id from A)
select ... from C where b_id = ?
select ... from C where b_id = ?
...
select ... from C where b_id = ?

Are there any limitations on nested subselects?


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.