mseritan wrote:
I apologize, I am still missing something. The way I used this in the past is that I created an object, left the id parameter as null (or what ever you set as unsaved-value) and save it to the database. When you save the database fills in the field. After this point you do not change the ID.
At what point are you trying to increment and what?
Sorry for the confusion... Increment is the generator cloass that is being set. So instead of using
<id name="id" column="id" type="integer" unsaved-value="0" >
<generator class="native" />
</id>
or
<id name="id" column="id" type="integer" unsaved-value="0" >
<generator class="identity" />
</id>
I am forced to use:
<id name="id" column="id" type="integer" unsaved-value="0" >
<generator class="increment" />
</id>
Which is not cluster safe and does a Select Max(id) prior to the insert.