|
There are 2 ways to deal with this when using an HBM mapping file:
-
use ID generator "enhanced-sequence" instead of "sequence";"enhanced-sequence" initializes the sequence to 1.
-
add a parameter with an initial value, for example:
<id name="id" column="id">
<generator class="sequence">
<param name="parameters">start with 10</param>
</generator>
</id>
I changed SequenceGeneratorTest so it will be skipped for SQLServer2012Dialect; instead I added SQLServer2012SequenceGeneratorTest with a mapping that provides an initial value as above. I also changed the mapping for CriteriaQueryTest to use "enhanced-sequence" instead of "sequence" (since the type of sequence is not relevant to the test).
I've pushed this to 4.2 and 4.3. Using <generator class="enhanced-sequence" /> is currently broken, so I haven't pushed this to master yet.
|