Quote:
Your second suggestion is to traverse the parents in Java code; what do you mean by this? Are you suggesting that I use Transformation.DISTINCT_ROOT_ENTITY and for each result returned I completely reload it using its id so as to obtain all the children? This seems like it would work (except, potentially, because I .clear() the session as previously stated) but would kill performance.
Yes,I am suggesting exactly that. At least, the parents will provide you some breakdown in the number of children.
Remember to use a lazy parent-child association.
If the number of children depending on each individual parent is acceptable, then use a fetch="join" mapping.
Otherwise use fetch="selct/subselect", or set a batch size=20, or even write a new query and use scroll() with it.