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
|