-->
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: Parent cascade Child save is issuing SQL Updates?
PostPosted: Mon Mar 24, 2014 5:46 pm 
Regular
Regular

Joined: Wed Dec 17, 2003 1:58 pm
Posts: 102
Hi All-
I am doing a batch save of a Parent object with many Child objects mapped as OneToMany in JPA, with cascade save. My identifiers are generated table, for both the parent and child. I have configured inserts and updates to be ordered (hibernate.order_inserts=true,hibernate.order_updates=true). What I am seeing is a batched insert of the Parents, a batched insert of the Children (minus the foreign key column), then updates for all the Children to add the FK. I don't understand this behavior, the FK is available at the time of inserting the Children so I'd have expected it to be inserted instead of triggering all the updates. Is there a way around this?

Thanks!


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.