I have an object tree where in this particular case, the parent object exists, and a one to many set of children has one child already. Then the user adds another child and updates the parent. In code, I am functionally calling session.merge(parent).
I see the sql log show that the insert is performed on the child, the update is performed on the parent. But when I do session.flush() afterward, I’m under the impression that it should fill the inserted object with it’s DB generated identifier. It did it in the pure insert situation when the parent was inserted. But not when the parent is being updated.
I don’t understand why hibernate is not populating that identifier.