I am getting the below error:
“Error while saving customer: Found two representations of same collection: com.core.model.impl.ContactInfoImpl.contactTypeDetails”
[classes are: ContactInfo and ContactInfoDetails]
code from hbm files:
In Parent class:
<hibernate-mapping package="com.beacon.core.model.impl" default-lazy="true" default-cascade="all-delete-orphan">
<class name="ContactInfoImpl" table="CONTACT_INFO">
<bag name="contactTypeDetails" inverse="true">
<key column="CONTACT_INFO_ID"/>
<one-to-many class="ContactTypeDetailImpl"/>
</bag>
</class>
<query name="com.core.model.impl.ContactInfoImpl.select.all">
<![CDATA[
from com.core.model.impl.ContactInfoImpl as entity
]]>
</query>
and the child class:
<hibernate-mapping package="com.core.model.impl" default-lazy="true" default-cascade="all-delete-orphan">
<class name="ContactTypeDetailImpl" table="CONTACT_TYPE_DETAIL" >
<many-to-one
name="contactInfo"
column="CONTACT_INFO_ID"
class="ContactInfoImpl"
not-null="false"
/>
<query name="com.core.model.impl.ContactTypeDetailImpl.select.all">
<![CDATA[
from com.core.model.impl.ContactTypeDetailImpl as entity
]]>
</query>
we weren’t doing manual session management ! Looks like it is a cascase issue with reference to another post:
http://www.damnhandy.com/2008/08/20/hib ... ion-error/But the cascade in the mapping file is :default-cascade="all-delete-orphan"
Not sure which piece needs a fix?
Your help is very much appreciated !