Hi all,
I'm using Hibernate and all features is very good.
However, in
some cases I need to load an object with yours collections. In these cases the Hibernate have the
lazy and
fetch features.
But, I need this behavior in
some cases.
So, it would be interesting an
depth keyword in HQL.
Thus, it would be possible create these queries:
Code:
"from Group g left join fecth depth 3 u.groups"
"from Group g left join fecth depth 2 u.groups g1 left join fecth depth 5 g1.groups"
"from Group g left join fetch depth * u.groups"
This queries returns, respectively:
The group and yours 3 superior groups.
The group and yours 2 superiors groups and, for each of these groups, yours 5 superiors groups.
The group and
all hierarchy of superior groups.
PS> Considering that a group have an auto-relationship, and the lazy attribute equals true.
Well, its my sugestion for Hibernate team.