HHH-16667 Use identifier table key mapping in version update restriction

This commit is contained in:
Marco Belladelli 2023-06-22 14:40:10 +02:00
parent d0942659c1
commit 9822457b8a
1 changed files with 3 additions and 2 deletions

View File

@ -1616,14 +1616,15 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
return null;
}
else {
final EntityTableMapping identifierTableMapping = entityPersister().getIdentifierTableMapping();
final TableUpdateBuilderStandard<JdbcMutationOperation> updateBuilder =
newTableUpdateBuilder( entityPersister().getIdentifierTableMapping() );
newTableUpdateBuilder( identifierTableMapping );
updateBuilder.setSqlComment( "forced version increment for " + entityPersister().getRolePath() );
updateBuilder.addValueColumn( versionMapping );
updateBuilder.addKeyRestrictionsLeniently( entityPersister().getIdentifierMapping() );
updateBuilder.addKeyRestrictionsLeniently( identifierTableMapping.getKeyMapping() );
updateBuilder.addOptimisticLockRestriction( versionMapping );
addPartitionRestriction( updateBuilder );