I'm not sure if I have something configured wrong or this is the correct behavior for Hibernate (I doubt it) but here it goes.
I have a table of employees. Each employee can be affiliated with another employee through an extra table containing information about how they are related.
So I have an Employee mapping with a <set...> of Relations. Each Relation has another Employee (different than the first) related to it in a <many-to-one...> relationship.
When I traverse this path, I can get the base Employee, from there I can get the relationship, from there I can get the second Employee but when I try to access any related data for that employee, it all comes back null. So it feels like it looses all the mappings to other tables the second time around.
Does anyone know if there is some property I need to set to get this to allow me to continue to traverse the data?
Yes, the exact name I do not remember. But in your mapping you can state how far down you want to go. How many levels? So in the circular reference you can say set it to go 5 levels deep. I think you are seeing the default depth. I think "depth" is part of the name, but don't remember the tag name.
There is a property, hibernate.max_fetch_depth that you can declare in the XML config file. This doesn't seem to do the trick though. I've set it to 10 which should be more than enough and enabled outer-joins through the entire path of objects I need to traverse and it still comes back as null when I try to get a collection out of the second Employee.
Any other ideas? Or is there something I'm missing on this?