The reason why this is happening is because for SQL Server, a bigint sequence ranges from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
By default, the first sequence value returned by SQL Server is -9,223,372,036,854,775,808.
I think that for a property of type java.sql.Types.BIGINT, the scale for the column should be 0 by default (not 2). There should be no need to add scale="0".
FWIW, I confirmed that this also works:
<class name="Entity">
-
<id name="id" column="ID" type="big_integer">
+ <id name="id" type="big_integer"> + <column name="ID" precision="21" /> <generator class="sequence"> </generator> </id>
|