final SessionFactoryImplementor factory = lockable.getFactory();
final Update update = new Update( factory.getDialect() );
update.setTableName( lockable.getRootTableName() );
update.addPrimaryKeyColumns( lockable.getRootTableIdentifierColumnNames() );
update.setVersionColumnName( lockable.getVersionColumnName() );
update.addColumn( lockable.getVersionColumnName() );
if ( factory.getSettings().isCommentsEnabled() ) {
update.setComment( lockMode + " lock " + lockable.getEntityName() );
}
return update.toStatementString();
}