I have a mapping that looks like this:
<hibernate-mapping>
<class name="KeyManagement" table="KEY_MANAGEMENT">
<id name="id" column="KEY_MANAGEMENT_ID">
<generator class="native"/>
</id>
<property name="keyValue" type="string" column="KEY_VALUE" not-null="true"/>
<one-to-one name="entity" class="Entity"/>
</class>
</hibernate-mapping>
When I execute this code, the field ENTITY_ID in KEY_MANAGEMENT receives only a NULL value
KeyManagement km = new KeyManagement();
km.setEntity(ent);
session.save(km);
Where ent has already been saved in a previous transaction. Does anyone have any idea what might be going wrong with my one-to-one relationship here? I have successfully handled similar things with many-to-one relationships before, but for some reason, this is getting ignored.
Any help would be greatly appreciated!
|