HHH-16213 Avoid initializing lazy table group joins in AbstractSqlAstWalker

This commit is contained in:
Marco Belladelli 2023-03-01 11:04:13 +01:00 committed by Christian Beikov
parent 425879d9a7
commit 4d46294088
1 changed files with 6 additions and 1 deletions

View File

@ -434,7 +434,12 @@ public class AbstractSqlAstWalker implements SqlAstWalker {
@Override
public void visitTableGroupJoin(TableGroupJoin tableGroupJoin) {
tableGroupJoin.getJoinedGroup().accept( this );
final TableGroup joinedGroup = tableGroupJoin.getJoinedGroup();
if ( joinedGroup.isInitialized() ) {
// Only process already initialized table groups to avoid
// forced initialization of joined lazy table groups
joinedGroup.accept( this );
}
if ( tableGroupJoin.getPredicate() != null ) {
tableGroupJoin.getPredicate().accept( this );
}