Revert "EntityCollectionPart#generateFetch() add TableGroupJoin to EntityCollectionPartTableGroup"

This reverts commit f5351addb8155bd85fbd38f5b989ef0a260bcf3f.
This commit is contained in:
Andrea Boriero 2020-02-01 08:53:24 +00:00
parent 8c377e9208
commit d34353e2a3
1 changed files with 1 additions and 28 deletions

View File

@ -27,12 +27,7 @@ import org.hibernate.metamodel.mapping.ModelPart;
import org.hibernate.metamodel.model.domain.NavigableRole;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.query.NavigablePath;
import org.hibernate.sql.ast.SqlAstJoinType;
import org.hibernate.sql.ast.spi.SqlAliasBaseManager;
import org.hibernate.sql.ast.tree.from.StandardTableGroup;
import org.hibernate.sql.ast.tree.from.TableGroup;
import org.hibernate.sql.ast.tree.from.TableGroupJoin;
import org.hibernate.sql.ast.tree.select.QuerySpec;
import org.hibernate.sql.results.graph.DomainResult;
import org.hibernate.sql.results.graph.DomainResultCreationState;
import org.hibernate.sql.results.graph.Fetch;
@ -169,29 +164,7 @@ public class EntityCollectionPart
.getTableGroup( fetchParent.getNavigablePath() );
assert collectionTableGroup != null;
NavigablePath navigablePath = new NavigablePath( entityMappingType.getRootPathName() );
TableGroup rhsTableGroup = creationState.getSqlAstCreationState()
.getFromClauseAccess()
.resolveTableGroup( navigablePath,
npa-> {
final QuerySpec rootQuerySpec = new QuerySpec( true );
return entityMappingType.createRootTableGroup(
npa,
null,
true,
LockMode.NONE,
new SqlAliasBaseManager(),
creationState.getSqlAstCreationState().getSqlExpressionResolver(),
() -> rootQuerySpec::applyPredicate,
creationState.getSqlAstCreationState().getCreationContext().getSessionFactory()
);
});
TableGroupJoin tableGroupJoin = new TableGroupJoin(
navigablePath,
SqlAstJoinType.LEFT,
rhsTableGroup
);
collectionTableGroup.addTableGroupJoin( tableGroupJoin );
// create a "wrapper" around the collection TableGroup adding in the entity's table references
return new EntityCollectionPartTableGroup( fetchablePath, collectionTableGroup, this );
}