HHH-9062 Fix failing tests

This commit is contained in:
Chris Cranford 2021-11-27 05:49:47 -05:00
parent 6c1db681fe
commit dd8f1a31a7
1 changed files with 4 additions and 6 deletions

View File

@ -496,7 +496,7 @@ public class ValidityAuditStrategy implements AuditStrategy {
if ( configuration.isRevisionEndTimestampEnabled() && !configuration.isRevisionEndTimestampUseLegacyPlacement() ) {
if ( entity instanceof JoinedSubclassEntityPersister ) {
// iterate subclasses, excluding root
while ( entity.getEntityMetamodel().getSuperclass() != null ) {
while ( entity.getMappedSuperclass() != null ) {
contexts.add(
getNonRootUpdateContext(
entityName,
@ -566,8 +566,8 @@ public class ValidityAuditStrategy implements AuditStrategy {
}
// Apply "WHERE (entity_id) = ?"
context.addPrimaryKeyColumns( entity.getIdentifierColumnNames() );
context.bind( id, entity.getIdentifierType() );
context.addPrimaryKeyColumns( rootEntity.getIdentifierColumnNames() );
context.bind( id, rootEntity.getIdentifierType() );
// Apply "AND REV <> ?"
final String path = configuration.getRevisionNumberPath();
@ -630,8 +630,6 @@ public class ValidityAuditStrategy implements AuditStrategy {
// Apply "AND REVEND_TSTMP is null"
context.addWhereColumn( auditEntity.toColumns( revEndTimestampColumnName )[ 0 ], " is null" );
session.createQuery( "From " + auditEntityName + " WHERE originalId.REV.id <> " + revisionNumber ).list();
return context;
}