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