-->
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: many-to-one mapping inverse=true?
PostPosted: Mon Jul 12, 2004 7:40 pm 
Newbie

Joined: Mon Jul 12, 2004 7:31 pm
Posts: 3
Hi,

I have a many-to-one association between two objects A & B.

A has a reference to B. & I have declared a many-to-one relationship on the property of A that refers to B. cascade is set to true.

When I do a save the insert for B is done before the insert for A. Is there a way to force A to be saved first? This is important because the primary key of A that is generated through a sequence is used as a foreign key in B.

I do not want to change my object structure and make B have a reference to A to achieve this. Would anyone know of a way to do this through hibernate mapping?

Thanks
Pratima


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 12, 2004 9:40 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Please read the red box before posting.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.