-->
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: How to save parents and kids in arbitrary order?
PostPosted: Fri Jul 22, 2005 6:27 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
I have a one-to-one relation from Person to Employee. Since the Person must have an employe it's set to not-null="true".

Code:
<many-to-one name="person" class="Person" column="PERSON_ID" unique="true" not-null="true"/>


Code:
<one-to-one name"employee" class="Employee" property-ref="person"/>


If I do a session.save for the Employee first and then the Person (kid first and then parent) everything works nice. If I do it the other way round I get a PropertyValueException.

Is there a way to get this working with saving kids and parents in arbitrary order?

Best Regard
Ernst


Hibernate version:
3.0

Name and version of the database you are using:
MySql 4.1


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.