.. because .of your setxxx() methods
I just wanted to post a situation, in that lazy loading does not work. I took me some time to find it out. The code worked well. But as we later wanted to use the "lazy" feature, it just stayed unlazy:
Code:
public void setChildren( Set children )
{
if ( children == null || children.isEmpty() )
return;
for ( Iterator iter = children.iterator(); iter.hasNext(); )
{
if ( !( iter.next() instanceof TreePermissionGroupNode) )
throw ( new IllegalArgumentException("Only TreePermissionGroupNodes allowed") );
}
_children = children;
}
Well, hibernates tries to set a collection proxy here, but just in the set method, it is forced to retrieve the data.