I have an object "Contract" that has a one-to-one mapping with an "Property". When I create a new Contract and save it, the Property object is also saved and persisted to the database.
However, when I update the Contract and Property objects and attempt to persist, the Contract object is updated, however the modified Property object is not updated.
I checked the SQL output, and there is an update entry for the Contract object.
TIA
Hibernate version:
2.1.6
Mapping documents:
Code:
<class name="com.acme.Contract" >
<meta attribute="class-description">
Contract Rule Value
</meta>
<id name="id" type="integer">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>
<one-to-one name="insuredProperty" class="com.acme.Property" cascade="save-update"/>
...
Code:
<class name="com.acme.Property" >
<meta attribute="class-description">
Contract Property
</meta>
<id name="id" type="integer">
<generator class="foreign">
<param name="property">contract</param>
</generator>
</id>
<one-to-one name="contract" class="com.acme.Contract" constrained="true"/>
...