-->
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.  [ 3 posts ] 
Author Message
 Post subject: error using version attribute as unsaved-value
PostPosted: Mon Jul 26, 2004 1:07 pm 
Beginner
Beginner

Joined: Fri Jan 16, 2004 3:22 pm
Posts: 26
hello,
i have a class with a composite-id, i wanted to implement the version based strategy to distinguish between saved and unsaved values as the doc says:
Quote:
As an alternative, you may also set the unsaved-value attribute on a <version> (or <timestamp>) element
to specify a value that indicates a new transient instance.


what i've done is:
Code:
<composite-id name="comp_id" class="AnB_PK" unsaved-value="myVersionAttr">

<version column="version" name="myVersionAttr"  type="int"  />


but the dtd doesn't allow other value than "any/none" for the unsaved-value attribute.
so how should i relate the version and the unsaved-value attribute?

regards
Gerardo.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2004 4:06 pm 
Beginner
Beginner

Joined: Thu Jun 24, 2004 1:04 pm
Posts: 35
Location: Minnesota - USA
Remove the "unsaved-value" off the <composite-id>.

Now, read this:
http://www.hibernate.org/hib_docs/refer ... on-version

In my case I use something like:
Code:
   <version name="updateNu" unsaved-value="negative" column="UPDATE_NU" type="integer"/>


In addition, all of my POJOs extend from a base class that will initialize the updateNu property to -1 on object construction.

--gus


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 2:54 pm 
Beginner
Beginner

Joined: Fri Jan 16, 2004 3:22 pm
Posts: 26
thanks a lot


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

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.