-->
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: Versioning Problem in Hibernate
PostPosted: Tue Jun 20, 2006 6:18 am 
Newbie

Joined: Tue Jun 20, 2006 5:58 am
Posts: 1
Hi,

I have a collection of "Students" inside the "Class" object. While adding a student I add the student to the Class and try saving the class object. Now,I have added the version in the Student Object and when I add a new Student to the Class and try saving the Class object,the version of all the previously added students also changes.I want some mapping attribute,which does not update the previously added objects and adds only the newly added Student object to the collection Class .

Here is the sample mapping

<class name="x.y.z.ClassA" table="CLASS_A">
<id name="id" type="long" column="ID" unsaved-value="0">
<generator class="native"/>
</id>
<list name="students" lazy="true"
cascade="all-delete-orphan" access="field">
<key column="CLASS_A_ID"/>
<index column="SORT_INDEX"/>
<one-to-many class="x.y.z.Student"/>
</list>
</class>

<class name="x.y.z.Student" table="STUDENT">
<id name="id" column="ID" type="long">
<generator class="native"/>
</id>
<version
column="version_column"
name="version"
type="long"
/>
</version>
</class>


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.