-->
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: property under properties does not get saved
PostPosted: Fri Apr 03, 2009 11:47 pm 
Newbie

Joined: Fri Apr 03, 2009 11:36 pm
Posts: 1
I have this mapping (simplified)

<class name="Component" table="comp_catalog">
...
<many-to-one name="currentVersion" class="CompVersion" property-ref="CurrentCompVersion" cascade="save-update">
<formula>component_id</formula>
<column name="current_version" not-null="true" />
</many-to-one>
...
</class>

<class name="CompVersion" table="comp_versions">
...
<properties name="CurrentCompVersion" unique="true">
<many-to-one name="component" class="Component" column="component_id"/>
<property name="version" column="version" insert="true" update="true"/>
</properties>
...
</class>

in code i have an instance of Component entityComponent and an instance of CompVersion compVersion,

...
EntityManager em = getEntityManager();
entityComponent.setCurrentVersion(compVersion);
persistEntity(em, compVersion);
persistEntity(em, entityComponent);
...

it inserts into both comp_catalog and comp_versions, comp_catalog.current_version saves correctly with the value (say 1), but comp_versions.version does not save the same value (it is 0).

What am i doing wrong?

Thanks
Shannon


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.