Hi
Just to clarify - I think that you (Justin) are confusing the initialisation of the parent and the children.
The 'join fetch' phrase allows you to eagerly initialise a 'child' collection in a join. It doesn't matter how many parent instances there are in the resulting cartesian product - all the elements of the collection that you specify to join fetch will be eagerly initialised. These elements may be associated with different parents, but their collection role is the same (see below)
Now the restriction (from the docs)
Quote:
Note that, in the current implementation, only one collection role may be fetched in a query.
Note the use of the words 'collection role' - What the guys are saying here is that the eagerly fetched collections may manifest itself in more than a single collection (e.g. Parent instance A has a collection containing elements of class X, and Parent instance B has a collection containing elements of class X) but must have the same 'role' (in this case X). So you can't do:
Code:
from eg.Cat as cat
left join fetch cat.friends
left join fetch cat.kittens
..assuming cat 1-----* kittens and cat 1------* friends
Note however that you can do (from the docs)
Code:
from eg.Cat as cat
inner join fetch cat.mate
left join fetch cat.kittens
.. as the mate association is not a collection.
Lazy initialisation of Parents happens via proxying - which is another kettle of fish...