Hi,
When i load my parent object, it seems that hibernate load the same child object twice, because it can be found in a map and in a many-to-one relation, so i have tried to set cascade=none in the many-to-one relation, but with no success, i cannot change my db model because sometime, the object in the many-to-one relation is not in the map.
Here is the mapping:
<many-to-one
name="firsttaskparameter"
class="com.recruitsoft.rcc.persistence.hibernate.Taskparameter"
not-null="true"
cascade="none"
>
<column name="FIRSTTASKPARAMETERNO" />
</many-to-one>
<map
name="taskparameters"
lazy="true"
inverse="true"
order-by="taskparameterno asc"
cascade="all-delete-orphan"
>
<key>
<column name="TASKNO" />
</key>
<index column="TASKPARAMETERNO" type="java.lang.Long"/>
<one-to-many
class="com.recruitsoft.rcc.persistence.hibernate.Taskparameter"
/>
</map>
Exception is: net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 308, of class: .....persistence.hibernate.Taskparameter
Thanks
Richard
|