-->
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 for empty String
PostPosted: Tue Apr 13, 2010 8:44 am 
Newbie

Joined: Tue Mar 09, 2010 5:17 pm
Posts: 3
I want to have Hibernate looking for empty string "" for unsaved object, what should unsaved-value attribute be set to? Should it be unsaved-value=""?

And for long typed id, is it better to set <id name="id" type="long" unsaved-value="-1">?

I use to have unsaved-value="null" for String id = null. But because we do id comparison in our code a lot, resulting in more code to handle NullPointerException for unsaved object, we decided it's easier to initialize the id string to empty string. Any thoughts would be appreciated. Thanks. Using Hibernate 3


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.