With hibernate 2.1.7c I can not get the full object graph to load without 2 calls to the database
Code:
class XO{
long id;
String xString;
Set yset
}
class YO{
long id;
String yString;
Set zset
}
class ZO{
long id;
String zString;
}
from XO x
left join fetch x.yset y
left join fetch y.zset z
where x.id = '21'
and y.yString = "halb"
The select hibernate creates contains all 3 elements (XO,YO,and ZO) inner joined properly
As soon as I access YO another select is generated for YO, the sql doesn't have any elements of ZO. It appears ZO is fetched eagerly but YO isn't. Is there anyway to fetch the whole graph in one query?