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 7c832c024c
commit f9bc29f484
1 changed files with 6 additions and 1 deletions

View File

@ -434,7 +434,12 @@ public class AbstractSqlAstWalker implements SqlAstWalker {
@Override @Override
public void visitTableGroupJoin(TableGroupJoin tableGroupJoin) { 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 ) { if ( tableGroupJoin.getPredicate() != null ) {
tableGroupJoin.getPredicate().accept( this ); tableGroupJoin.getPredicate().accept( this );
} }