-->
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.  [ 2 posts ] 
Author Message
 Post subject: Is there unsaved-value="" equivalent in JPA annota
PostPosted: Mon Jan 07, 2008 11:37 pm 
Newbie

Joined: Thu Jan 03, 2008 7:21 pm
Posts: 15
i.e. How do I specify unsaved-value="" for the following

Code:
@Id @GeneratedValue(strategy=GenerationType.AUTO)
public Long getId() {
  return id;
}


Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 08, 2008 12:35 am 
Newbie

Joined: Thu Jan 03, 2008 7:21 pm
Posts: 15
Probably No.

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.  [ 2 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.