-->
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: initialization of primitive id needed?
PostPosted: Thu May 12, 2005 9:23 am 
Newbie

Joined: Thu Feb 10, 2005 12:29 pm
Posts: 6
hello,
I have a stupid question:

I'm using an id of primitive type (long) using a sequence of oracle.
I use the unsaved-value="-1"

<class name="it.mobis.sms.Group" table="MCS_GROUP">
<id name="id" type="long" unsaved-value="-1" >
<column name="ID" sql-type="number(7,0)" not-null="true"/>
<generator class="sequence">
<param name="sequence">MCS_GROUP_SEQUENCE</param>
</generator>
</id>
.....

In the constructor of this object, (when I create an unsaved Group object) must I initialize the "id" at the value -1 ?

If I mustn't initialize the "id" at the value -1, how can hibernate understand that it is "unsaved"?

excuse for my dumb question

Stefano


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.