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