-->
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: Hibernate child parent update
PostPosted: Thu Feb 12, 2009 2:22 pm 
Newbie

Joined: Thu Feb 12, 2009 2:20 pm
Posts: 1
Hi,


any ideas


i have 2 tables, tableParent and tableChild,


tableChild is a child table of tableParent,


the relationship is 1-to-many and in tableChild there is a field "tableParentId",

i want to do an update on tableParent and there will be new rows in tableChild,

but what i'm trying to do is:
* remove previous rows in tableChild that corresponded to tableParent
* update tableParent
* insert new rows into tableChild with details of the updated tableParent


any ideas?


Cheers in advance,

Niall


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2009 5:48 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Check out this example in the Hibernate documentation http://www.hibernate.org/hib_docs/v3/re ... child.html


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.