-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Getting org.springframework.dao.DataIntegrityViolationExcept
PostPosted: Fri Jul 01, 2005 3:27 am 
Newbie

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.