Joined: Wed Aug 04, 2010 5:39 am Posts: 3
|
Hello,
I am quite new to hibernate and i would be glad if you could help. A part of the domain are entities action and action_parameter (1:m). The problem arise when i try to save an action that has many parameters with actionDao.save(Entity). Parameters are set with actionDao.setParrameters(ParameterSet set).
Result is an exception: "a different object with the same identifier value was already associated with the session:com....*** nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session"
What can be an option? should i first try to save the action and after that parameters or can I save them together? I can see that if the ParameterSet has just one object the problem disappears so probably there is a problem with the increment of ids in the parameters entity. How does hibernate know which id is appropriate for a new insert?
Can you suggest me some tutorial how does hibernate execute inserts of objects when the result is written in multiple entities?
|
|