I have a one-to-many list relationship. Sometime I want to duplicate the containing object.
I change the containing object key property and insert it. The new object is really created, but when cascaded to the contained list - Hibernate finds existing rows and it updates them. I want him to insert new rows and refer them to the newly created parent.
I tried to use "identity" as generator for child pk, but this didn't help, he still found the existing child and updated it.
Is there a way to force INSERT for the cascaded collection in case of an INSERT on the parent?
|