So the issue is as follows:
Quote:
saveOrUpdateCopy
method will try to reassosiate an object to a session, since the unsaved-value="null" in your case and the new object assosiated is also having
null as the id , threfore for Hibernate these to are the same entities with same ids.
The apis say for
saveOrUpdateCopy :
Copy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved or does not exist in the database, save it and return it as a newly persistent instance. Otherwise, the given instance does not become associated with the session
(Check the mark in bold)
Net Net: Change either of the two
unsaved-value or the
default ids for uor domain models.
By the way
saveOrUpdateCopy is deprecated in latest version better use
merge() if you think to take up v3.