I have a model that looks like this:
A -- Many-toMany --> B -- Many-toMany --> C
Both A and B have the CascadeType of All and FetchType of Lazy.
When I make the following call:
A mergedA = (A) session.merge(a);
The mergedA has the collection of B objects resolved. B however does not have its collection of C objects resolved.
If I make the following call:
B mergedB = (B) session.merge(b);
The mergedB has the collection of C objects resolved.
If both A and B have the CascadeType of All, why does the collections of C objects not get resolved for the collection of Bs when I call session.merge(a);?
Its because, it does it for the single step deep in the object graph and
Cis at the second step. Thus, it did just for the immediate one.