Top Description Methods
org.hibernate.sql.ast.tree.from

public Interface TableGroup

extends SqlAstNode, ColumnReferenceQualifier, SqmPathInterpretation, DomainResultProducer
Known Direct Subinterfaces
org.hibernate.sql.ast.tree.from.VirtualTableGroup, org.hibernate.sql.ast.tree.from.PluralTableGroup
Known Direct Implementers
org.hibernate.sql.ast.tree.from.AbstractTableGroup, org.hibernate.sql.ast.tree.from.DelegatingTableGroup, org.hibernate.sql.ast.tree.from.MutatingTableReferenceGroupWrapper, org.hibernate.sql.ast.tree.from.OneToManyTableGroup
Imports
java.util.List, java.util.function.Consumer, org.hibernate.metamodel.mapping.EntityValuedModelPart, .ModelPart, .ModelPartContainer, org.hibernate.spi.NavigablePath, org.hibernate.query.sqm.sql.internal.DomainResultProducer, .SqmPathInterpretation, org.hibernate.sql.ast.SqlAstJoinType, .SqlAstWalker, org.hibernate.sql.ast.tree.SqlAstNode, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState

Group together TableReference references related to a single entity or collection, along with joins to other TableGroups
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public default void
public void
addNestedTableGroupJoin(TableGroupJoin join)

A nested table group join is a join against a table group, that is ensured to be joined against the primary table reference and table reference joins in isolation, prior to doing other table group joins e.g. select * from entity1 e left join ( collection_table c1 join association a on a.id = c1.target_id ) on c1.entity_id = e.id and c1.key = 1 is modeled as TableGroup( primaryTableReference = TableReference(entity1, e), tableGroupJoins = [ TableGroupJoin( TableGroup( primaryTableReference = TableReference(collection_table, c1), nestedTableGroupJoins = [ TableGroupJoin( TableGroup( primaryTableReference = TableReference(association, a) ) ) ] ) ) ] ) This is necessary to correctly retain the cardinality of an HQL join like e.g. from Entity1 e left join e.collectionAssociation c on key(c) = 1

public void
public void
public default void
applySqlSelections(DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Used when this producer is a selection in a sub-query.
public boolean
public default DomainResult<J>
public default TableGroupJoin
findCompatibleJoin(TableGroupJoinProducer joinProducer, SqlAstJoinType requestedJoinType)

public default TableGroup
public default TableGroupJoin
public String
getGroupAlias()

If we want to use CTE for TableGroup rendering we will need to know the alias we can use for the group

public ModelPartContainer
public NavigablePath
public List<TableGroupJoin>
public TableReference
public String
public List<TableGroupJoin>
public List<TableReferenceJoin>
public default boolean
public default boolean
public default boolean
isInitialized()

If this is a lazy table group, it may report that it is not initialized, which would also mean that a join referring to this table group should not be rendered.

public default boolean
public default boolean
public default boolean
isVirtual()

Utility method that indicates weather this table group is virtual or not

public void
prependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)

Adds the given table group join before a join as found via the given navigable path.

public void
public void
Inherited from org.hibernate.query.sqm.sql.internal.SqmPathInterpretation:
getExpressionTypegetSqlExpression
Inherited from org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier:
getTableReferencegetTableReferencegetTableReferencegetTableReferenceresolveTableReferenceresolveTableReferenceresolveTableReference

Method Detail

acceptback to summary
public default void accept(SqlAstWalker sqlTreeWalker)

Implements org.hibernate.sql.ast.tree.SqlAstNode.accept.

Annotations
@Override
addNestedTableGroupJoinback to summary
public void addNestedTableGroupJoin(TableGroupJoin join)

A nested table group join is a join against a table group, that is ensured to be joined against the primary table reference and table reference joins in isolation, prior to doing other table group joins e.g. select * from entity1 e left join ( collection_table c1 join association a on a.id = c1.target_id ) on c1.entity_id = e.id and c1.key = 1 is modeled as TableGroup( primaryTableReference = TableReference(entity1, e), tableGroupJoins = [ TableGroupJoin( TableGroup( primaryTableReference = TableReference(collection_table, c1), nestedTableGroupJoins = [ TableGroupJoin( TableGroup( primaryTableReference = TableReference(association, a) ) ) ] ) ) ] ) This is necessary to correctly retain the cardinality of an HQL join like e.g. from Entity1 e left join e.collectionAssociation c on key(c) = 1

addTableGroupJoinback to summary
public void addTableGroupJoin(TableGroupJoin join)
applyAffectedTableNamesback to summary
public void applyAffectedTableNames(Consumer<String> nameCollector)
applySqlSelectionsback to summary
public default void applySqlSelections(DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Doc from org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Used when this producer is a selection in a sub-query. The DomainResult is only needed for root query of a SELECT statement. This default impl assumes this producer is a true (Sql)Expression

Annotations
@Override
canUseInnerJoinsback to summary
public boolean canUseInnerJoins()
createDomainResultback to summary
public default DomainResult<J> createDomainResult(String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.query.sqm.sql.internal.DomainResultProducer.createDomainResult.

Doc from org.hibernate.query.sqm.sql.internal.DomainResultProducer.createDomainResult.

Produce the domain query

Annotations
@Override
findCompatibleJoinback to summary
public default TableGroupJoin findCompatibleJoin(TableGroupJoinProducer joinProducer, SqlAstJoinType requestedJoinType)
findCompatibleJoinedGroupback to summary
public default TableGroup findCompatibleJoinedGroup(TableGroupJoinProducer joinProducer, SqlAstJoinType requestedJoinType)
findTableGroupJoinback to summary
public default TableGroupJoin findTableGroupJoin(TableGroup tableGroup)
getGroupAliasback to summary
public String getGroupAlias()

If we want to use CTE for TableGroup rendering we will need to know the alias we can use for the group

getModelPartback to summary
public ModelPartContainer getModelPart()
getNavigablePathback to summary
public NavigablePath getNavigablePath()

Redeclares org.hibernate.query.sqm.sql.internal.SqmPathInterpretation.getNavigablePath.

getNestedTableGroupJoinsback to summary
public List<TableGroupJoin> getNestedTableGroupJoins()
getPrimaryTableReferenceback to summary
public TableReference getPrimaryTableReference()
getSourceAliasback to summary
public String getSourceAlias()
getTableGroupJoinsback to summary
public List<TableGroupJoin> getTableGroupJoins()
getTableReferenceJoinsback to summary
public List<TableReferenceJoin> getTableReferenceJoins()
hasRealJoinsback to summary
public default boolean hasRealJoins()
isFetchedback to summary
public default boolean isFetched()
isInitializedback to summary
public default boolean isInitialized()

If this is a lazy table group, it may report that it is not initialized, which would also mean that a join referring to this table group should not be rendered.

isLateralback to summary
public default boolean isLateral()
isRealTableGroupback to summary
public default boolean isRealTableGroup()
isVirtualback to summary
public default boolean isVirtual()

Utility method that indicates weather this table group is virtual or not

prependTableGroupJoinback to summary
public void prependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)

Adds the given table group join before a join as found via the given navigable path.

visitNestedTableGroupJoinsback to summary
public void visitNestedTableGroupJoins(Consumer<TableGroupJoin> consumer)
visitTableGroupJoinsback to summary
public void visitTableGroupJoins(Consumer<TableGroupJoin> consumer)