So you are not using hibernate for the legacy system at all, just for the new db system, correct?
If so, then you do not need to load the whole tree, just compare each object you retrieve from the legacy db using identifiers with what hibernate returns (also using identifiers or some way of uniquely identifying each object).
If you really must walk the tree, then you can do so as long as you keep the session open. Just walking the tree in
java will load the tree into a hibernate session, again, as long as it is open.
For example, let's say you have 3 hibernate managed entites, A, B, and C, related as follows:
A has a lazy-loaded bidirectional MTM relationship with B and each of them have a lazy bidirectional OTM-MTO relationship with C. Let's say you can identify A uniquely somehow. Then, simply calling A.getCollectionOfBs will load you all associated B entities and A or B .getCollectionOfCs will load each corresponding collection of Cs. Thus, you have the tree in memory and the open hibernate session. However, in order to do any deltas, you still have to have a way of finding each actual object A B and C which you want to compare with what is coming from the legacy system. It would probably be faster and easier if you could do so without loading the tree into memory and did it at the db/hibernate level on each object directly.