-->
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: save father-child with constraint
PostPosted: Thu Jul 27, 2006 4:21 pm 
Newbie

Joined: Tue Jul 25, 2006 8:59 am
Posts: 18
i have a association between two tables A and B
B have a field which is the id of A (ID_AL) :

<!-- Associations -->
<many-to-one name="Livraison" class="org.ultimania.model.Livraison" column="ID_AL" cascade="save-update"/>

i make a save of A , and a flush()

and after a save of B (which contain A id)

then i make a flush() and i have a violation :

Ora-xxx : parent key not exist.

Because i have a integrity constraint :
ALTER TABLE COMMANDE ADD CONSTRAINT FKABBFA7A42509EE
FOREIGN KEY (ID_AL) REFERENCES PLSVISTA.LIVRAISON (ID_AL) ;

i think the cascade="save-update" will be suffisant or the flush after the save of A , but not i have still a violation and i can make a commit.

thank for your help


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.