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 e31754086a
commit 6984c4a9e8
1 changed files with 15 additions and 1 deletions

View File

@ -913,7 +913,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
);
}