Hibernate version: 3.1
I do have a father object containing a collection of children, with a cascade set to "all-delete-orphan".
When I do a saveOrUpdate() on a newly created father, (ie: not in session), the children are correctly cascaded. For instance I could retrieve their database id (generated with "increment") just afterwards.
But if I modify an existing father (in my case, clearing the collection, and adding some children), and do a saveOrUpdate on the father, the children id are not set. (cascade not made ?)
I do have to wait after the session.commit() to be able to get the children id. (And in my design I need to get this id after the saveOrUpdate(), not after the commit()).
Note that my father does not have any other value changed. Only the elements in its collection.
Is it a known behavior? Do I have to browse myself the hierarchy, and manually save each of the children?
PS: sorry for the duplicate post. (The website was quite disturb at the moment of the post)
--
Hugo
|