-->
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: cant understand one-to-many database actions
PostPosted: Thu Mar 31, 2011 4:56 pm 
Newbie

Joined: Mon Feb 07, 2011 4:46 am
Posts: 4
Hi all,

I have a problem with my one-to-many collection mappings collection. I have a unidirectional one-to-many mapping. When I try to update parent, after adding one child to the parent, the actions given below are taken.

On one-to-many unidirectional mapping what actions are taken for INSERT and UPDATE? why does it do a update CHILd after INSERT child? And I dont understand why it tries to set PARENT_ID to null. If someone can help, it will be appreciated.

Kind Regards,


UPDATE PARENT:
Hibernate: select CHILD_SEQ.nextval from dual
Hibernate: insert into CHILD values (?)
Hibernate: update PARENT where PARENT_ID=?
Hibernate: update CHILD set PARENT_ID = null where PARENT_ID=?


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.