Joined: Fri Jun 17, 2005 2:17 am Posts: 5
|
Hi
I've parent table called supplier and child table called contact. Supplier has one to many relation with contact.
While I am trying to save the both I am getting the above exception
Hibernate is trying to save the child table first, and giving the following error.
org.springframework.dao.DataIntegrityViolationException: Hibernate operation: ORA-02291: integrity constraint (SCOTT.SYS_C005854) violated - parent key not found
; nested exception is java.sql.BatchUpdateException: ORA-02291: integrity constraint (SCOTT.SYS_C005854) violated - parent key not found
my supplier.hbm.xml looks like this
<hibernate-mapping default-cascade="all">
<class name="com.roche.dto.SupplierDTO" table="SUPPLIER">
<id name="dunsNumber" column="DUNS_NUMBER" unsaved-value="null">
<generator class="assigned" />
</id>
<property name="imtSponsor" column="IMT_SPONSOR" type="string"/>
<property name="companyHistoryInfo" column="COMPANY_HISTORY_INFO" type="string"/>
<property name="financialInfo" column="FINANCIAL_INFO" type="string"/>
<property name="serviceCoverage" column="SERVICE_COVERAGE" type="string"/>
<property name="globalReach" column="GLOBAL_REACH" type="string"/>
<property name="classifications" column="CLASSIFICATIONS" type="string"/>
<property name="relationshipDescription" column="RELATIONSHIP_DESCRIPTION" type="string"/>
<set name="contacts" table="CONTACT">
<key column="DUNS_NUMBER"/>
<one-to-many class="com.roche.dto.ContactDTO"/>
</set>
</class>
</hibernate-mapping>
can any one please help out to solve this problem. Its very urgent.
Regards
Sharmila
|
|