Hi Pinaki,
I have tried using a fetch group to load the grandchildren but unfortunately
this resulted in hundreds of queries being performed. The original query
was good in that it performed the left join fetch of parent and child
collections in a single query.
Is it possible to fetch parent, child, and grandchild collections in a
single query?
The first query I used:
SELECT p FROM Parent p LEFT JOIN FETCH p.childCollection
is executed in a single query but does not fetch grand children
If I add
@FetchGroup(name="fetchGrandchildren", attributes={
@FetchAttribute(name="grandchildCollection")
})
to the above it executes hundreds of queries instead of one.
--
View this message in context:
http://n2.nabble.com/left-join-fetch-on-Parents%2C-Children%2C-and-GrandChildren-tp2274260p2277556.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.