HHH-17711 Fix table reference join resolution for joined subtype

This commit is contained in:
Marco Belladelli 2024-02-06 13:04:33 +01:00 committed by Steve Ebersole
parent 83e844c1e8
commit f6fed506fc
2 changed files with 3 additions and 12 deletions

View File

@ -279,6 +279,7 @@ public class BasicFormatterImpl implements Formatter {
private void endCase() { private void endCase() {
afterBeginBeforeEnd = false; afterBeginBeforeEnd = false;
decrementIndent(); decrementIndent();
decrementIndent();
logical(); logical();
} }

View File

@ -1336,17 +1336,7 @@ public abstract class AbstractEntityPersister
@Override @Override
public boolean containsTableReference(String tableExpression) { public boolean containsTableReference(String tableExpression) {
if ( getTableName().equals( tableExpression ) ) { return contains( getSubclassTableNames(), tableExpression );
return true;
}
else {
for ( int i = 0; i < getSubclassTableSpan(); i++ ) {
if ( getSubclassTableName( i ).equals( tableExpression ) ) {
return true;
}
}
return false;
}
} }
@Override @Override
@ -3076,7 +3066,7 @@ public abstract class AbstractEntityPersister
rootTableReference, rootTableReference,
true, true,
sqlAliasBase, sqlAliasBase,
(tableExpression) -> contains( getSubclassTableNames(), tableExpression ), (tableExpression) -> getRootEntityDescriptor().containsTableReference( tableExpression ),
(tableExpression, tg) -> { (tableExpression, tg) -> {
final String[] subclassTableNames = getSubclassTableNames(); final String[] subclassTableNames = getSubclassTableNames();
for ( int i = 0; i < subclassTableNames.length; i++ ) { for ( int i = 0; i < subclassTableNames.length; i++ ) {