I am working on data export/import using dom4j + replicate.
in <one-to-many> and many-to-many> relation one record instance is found more than once. When one particular child record is encountered second time in the data it gives the following exception.
exception that occurs:
"Duplicate entry '40288ca8fd76c5ac00fd76c5ae530003-40288ca8fd76c5ac00fd76c5ae350001' for key 1"
Hibernate version: 3.0
Mapping documents:
Code:
<set name="contacts" table="ContactLocationRelationship" cascade="replicate" node="." embed-xml="true">
<key>
<column name="customerid" />
<column name="locationid" />
</key>
<many-to-many class="com.sbs.xml.info.XmlContactInfo" embed-xml="true">
<column name="contactid" />
</many-to-many>
</set>
Code between sessionFactory.openSession() and session.close():Code:
dom4jSession.replicate("com.sbs.xml.CustomerInfo", objElement, ReplicationMode.IGNORE);
Name and version of the database you are using: MySql 5.0
any help will be highly appreciated.