Hi All,
I have an application that one of the entities' id was defined as 'native':
Code:
<id name="id" column="id">
<generator class="native"/>
</id>
now, I would like to change the generator to use hilo algorithm:
Code:
<id name="id" column="id">
<generator class="org.hibernate.id.TableHiLoGenerator">
<param name="table">uid_table</param>
<param name="column">next_hi_value_column</param>
</generator>
</id>
However, since the table already existed (and had several entries in it), I would like the id generator not to start from '1', but from the next available id (if, for example, the last generated id was '10', I would like the next id to be no less than '11'). I do not expect it to be the exact number, but the problem now is that I get duplicate entries (with the same id) after the change.
My question is:
1. Can I define the first value that will be used as the ID?
2. Can I define the initial value for the ''next_hi_value_column" ? If i can change it to a greater number than the default, I will know for sure that the generated ids will be large enough and duplications will be avoided.
Do you have any idea?
Tnx!