I believe the simple answer is to use subselects, with eager fetching.
In your mapping config for each of the "sons" and "daughters" sets, add attributes lazy="false" and fetch="subselect". Then, you should be able to simplify your query to "from Person p where p.id = 5". It should eagerly fetch the sets, with subselects instead of joins.
To see what SQL it's generating, turn on SQL logging by turning on the following properties:
* hibernate.show_sql
* hibernate.format_sql
* hibernate.use_sql_comments
|