-->
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: one-to-one mapping won't write data
PostPosted: Fri Jan 12, 2007 2:24 pm 
Newbie

Joined: Tue Jan 24, 2006 12:40 pm
Posts: 7
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!


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.