i am writing one function in hibernate to recursively initialize all properties of object recursively so whole object graph is loaded.
i have two complex scenarios w
you can use Hibernate.initialize() on the object to initialise it. I'm not sure if this cascades. Otherwise you could check instanceof HibernateProxy which gives you an isInitialised property.
Update: since initialize does not cascade you need to traverse the tree like you do already. Use a Hashset to keep track of objects you already processed.