Using a left join fetch in hql, I'm able to retrieve a list made up of parent objects, with a set of child objects nested inside of it.
However, when I try using native SQL (ether by .createSQLQuery() or a named query), I end up with a list of objects, each object containing the parent object, and standalone child objects (not nested in the parent object).
My hql is tuned to the point where it matches my hand written sql. I've read the references, the forums, the books, and looked through the Hibernate JUnit test code. I've tried using both <load-collection> and <return-join>; still no luck.
Is it possible to retrieve complete assembled parent objects (populated with collections of children inside them) using native sql or name queries; or must I manually assemble them? And if it is possible, could someone please post an example.
|