HHH-16678 Use seed and next for version increase query literal

This commit is contained in:
Marco Belladelli 2023-06-14 11:09:09 +02:00
parent 249486432f
commit b08c0ace3c
1 changed files with 15 additions and 1 deletions

View File

@ -915,7 +915,21 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
value = new BinaryArithmeticExpression(
versionColumn,
ADD,
new QueryLiteral<>( 1, versionType ),
new QueryLiteral<>(
persister.getVersionJavaType().next(
persister.getVersionJavaType().seed(
versionMapping.getLength(),
versionMapping.getPrecision(),
versionMapping.getScale(),
null
),
versionMapping.getLength(),
versionMapping.getPrecision(),
versionMapping.getScale(),
null
),
versionType
),
versionType
);
}