Hello,
I have an application that uses disconnected sessions (using the saveOrUpdate option).
A while ago I implemented a 'clone'-option for business entities which worked by simply finding an existing entity and setting the id to null. The next saveOrUpdate would re-create the entity and duplicate all components
ex. Before clone:
Entity A linked to Foreign Entity X (using a map/list/...)
After clone + save:
Entity A linked to Foreign Entity X
Entity B linked to Foreign Entity X
(the db would hold both entities + 2 records in the link-table)
This worked fine since ever since 2.0 beta 1 up-to 2.1 beta 4. However, today I upgraded to 2.1.1 and this behaviour changed:
ex. Before clone:
Entity A linked to Foreign Entity X (using a map/list/...)
After a save, the db now holds both entities + only 1 record in the link-table
Entity A (which is no longer linked to Foreign Entity X)
Entity B linked to Foreign Entity X
(the db contains both entities + only 1 record in the link-table)
Is this expected behaviour? If so, is there a way to duplicate the old behaviour without implementing a manual deep clone of all objects?
Thanks in advance,
Ive
|