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.  [ 2 posts ] 
Author Message
 Post subject: cascade="save-update" ne fait le flush du pere
PostPosted: Thu Jul 27, 2006 9:23 am 
Newbie

Joined: Tue Jul 25, 2006 8:59 am
Posts: 18
Bonjour,

J'ai deux table A et B.

La B contient l'identifiant d'une ou plusieurs instances de A
B a une contraite d'intégrité : l'identifiant de A doit exister

j'ai donc une relation OnetoMany

Lorsque je fait un save d'un objet A , puis un save de plusiurs objets B qui contiennent l'identifiant A et que je fais un flush , j'ai une erreur de violation de l'intégrité au commit() me disant que le parent n'existe pas.

Pourtant j'utilise cascade="save-update"

voici mon association dans le fichier de Mapping de B

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 1:53 pm 
Newbie

Joined: Tue Jul 25, 2006 8:59 am
Posts: 18
i find the mistake , i have a trigger that increment id of father table.


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

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.