-->
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: unsaved-value strategy UNDEFINED
PostPosted: Mon Sep 04, 2006 9:36 pm 
Newbie

Joined: Mon Sep 04, 2006 9:23 pm
Posts: 1
Hi Guys,
I'm trying to get a handle on the java persistence api using hibernate3.2 (cr2 with hibernate annotations 3.2 cr1 and hibernate entitymanager 3.2 cr1). My first examples with @Id @GeneratedValue. These worked great. Now I have a simple 1 column table annotated as @Id but the user must enter the value of the column (i.e. not @GeneratedValue)

Now all I can get is Unsaved-value strategy UNDEFINED in the middle of the stack trace.

The only doco that I can find is as below. My interpretation of is is that I don't need a mapping file and it is no longer necessary to define an unsaved-value strategy. Is there a workaround? An hibernate annotation that I can use, perchance??

Many thanks

Mark


*************Hibernate Documentation*******************
Identifier mappings

The unsaved-value attribute is now optional, in most cases. Hibernate will use unsaved-value="0" as the default, where that is sensible.

Note: In Hibernate3, it is no longer necessary to implement Interceptor.isUnsaved() when using natural keys (assigned identifiers or composite identifiers) and detached objects. In the absence of any "hints", Hibernate will query the database to determine if an object is new or detached. However, the use of Interceptor.isUnsaved() might result in higher performance, since the database query can be avoided.


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.