There are 2 ways to deal with this when using an HBM mapping file: * 1) use ID generator " , org.hibernate.id. enhanced -sequence" .SequenceStyleGenerator, instead of "sequence"; " org.hibernate.id. enhanced -sequence" .SequenceStyleGenerator initializes the sequence to 1. * 2) add a parameter with an initial value, for example:
{code} <id name="id" column="id"> <generator class="sequence"> <param name="parameters">start with 10</param> </generator> </id> {code}
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 " org.hibernate.id. enhanced -sequence" .SequenceStyleGenerator 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=" org.hibernate.id. enhanced -sequence .SequenceStyleGenerator " /> is currently broken in master, so I haven't pushed this to master yet.
|