-->
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: 'select new' disables fetch join
PostPosted: Mon Jan 28, 2013 11:52 am 
Beginner
Beginner

Joined: Mon Apr 04, 2011 12:08 pm
Posts: 32
if I do

Code:
select a,b,
from A as a fetch all properties, B as b fetch all properties
where a.x=b.x


then hibernate generates only one SQL request like

Code:
select A.* , B.*
from A join cross B
where A.x=b.x

if I do

Code:
select new ValueObject(a,b,)
from A as a fetch all properties, B as b fetch all properties
where a.x=b.x


then hibernate will generate

Code:
select A.id , B.id
from A join cross B
where A.x=b.x

and for each returned lines does

Code:
select A.*
from A
where A.id=?

select B.*
from B
where B.id=?


I see no reason why the select with New could not benefit the fetch all properties


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.