-->
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: insertion order on cascade
PostPosted: Sat Feb 02, 2013 11:54 am 
Newbie

Joined: Fri Feb 01, 2013 2:51 pm
Posts: 3
I have a simple 4 entities(tables) structure:

a - columns: id(generated), x

b - columns: id(generated), a_id(fk to a), y

c - columns: id(generated), a_id(fk to a), z

d - columns: id(generated), b_id(fk to b), c_id(fk to c), w

relationships as follows:

a->b one-to-many unidirectional;

a->c one-to-many unidirectional;

b->d one-to-many unidirectional;

c->d one-to-many unidirectional

All relationships cascaded.

hibernate performs incorrect order of inserts when persisting a:

should be a,b,c,d

does: a,b,d and fails without having generated

How can I enforce the correct order?

However I can set b_id and c_id to nullable, but then I ,will have inserts and updates. I would like to avoid it.

Thanks

Mark

Set bi-directional to a-b, a-c and b-d. Saw some improvements but could not get rid of updates.


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.