-->
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.  [ 4 posts ] 
Author Message
 Post subject: Unsaved-value + Annotations
PostPosted: Wed May 04, 2005 10:34 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Hibernate version: 3.0.2

Is there an equivalent to XDoclet's unsaved-value in Hibernate Annotations?

Or how would Hibernate know that '0' is my unsaved value identifier when my id type is 'int'?

Rgds, Ales


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 10:41 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Quote:
Or how would Hibernate know that '0' is my unsaved value identifier when my id type is 'int'?


no problem for hibernate 3, it knows that for int id, unsaved-value = 0

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 11:00 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
How about if I wanted to set unsaved value to '-1' or some other x != 0?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 12:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate will either use the timestamp or version property, or will actually query the second-level cache or, worst case, the database, to see if the row exists in hibernate3 at least for assigned generators.
I hope we'll no longer need the error-prone unsaved-value anymore.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.