Package org.hibernate.sql.ast.tree.from
Interface TableGroup
-
- All Superinterfaces:
ColumnReferenceQualifier,DomainResultProducer,Expression,SqlAstNode,SqlSelectionProducer,SqmPathInterpretation
- All Known Subinterfaces:
PluralTableGroup,VirtualTableGroup
- All Known Implementing Classes:
AbstractTableGroup,CollectionTableGroup,CorrelatedPluralTableGroup,CorrelatedTableGroup,CteTableGroup,DelegatingTableGroup,FunctionTableGroup,LazyTableGroup,MappedByTableGroup,MutatingTableReferenceGroupWrapper,OneToManyTableGroup,QueryPartTableGroup,StandardTableGroup,StandardVirtualTableGroup,TableGroupImpl,UnionTableGroup,ValuesTableGroup
public interface TableGroup extends SqlAstNode, ColumnReferenceQualifier, SqmPathInterpretation, DomainResultProducer
Group togetherTableReferencereferences related to a single entity or collection, along with joins to other TableGroups
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaccept(SqlAstWalker sqlTreeWalker)voidaddNestedTableGroupJoin(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.voidaddTableGroupJoin(TableGroupJoin join)voidapplyAffectedTableNames(Consumer<String> nameCollector)default voidapplySqlSelections(DomainResultCreationState creationState)Used when this producer is a selection in a sub-query.booleancanUseInnerJoins()default DomainResultcreateDomainResult(String resultVariable, DomainResultCreationState creationState)Produce the domain querydefault TableGroupJoinfindCompatibleJoin(TableGroupJoinProducer joinProducer, SqlAstJoinType requestedJoinType)default TableGroupfindCompatibleJoinedGroup(TableGroupJoinProducer joinProducer, SqlAstJoinType requestedJoinType)default TableGroupJoinfindTableGroupJoin(TableGroup tableGroup)StringgetGroupAlias()If we want to use CTE for TableGroup rendering we will need to know the alias we can use for the groupModelPartContainergetModelPart()NavigablePathgetNavigablePath()List<TableGroupJoin>getNestedTableGroupJoins()TableReferencegetPrimaryTableReference()StringgetSourceAlias()List<TableGroupJoin>getTableGroupJoins()List<TableReferenceJoin>getTableReferenceJoins()default booleanhasRealJoins()default booleanisFetched()default booleanisInitialized()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.default booleanisLateral()default booleanisRealTableGroup()voidprependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)Adds the given table group join before a join as found via the given navigable path.voidvisitNestedTableGroupJoins(Consumer<TableGroupJoin> consumer)voidvisitTableGroupJoins(Consumer<TableGroupJoin> consumer)-
Methods inherited from interface org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier
getTableReference, getTableReference, getTableReference, getTableReference, resolveTableReference, resolveTableReference, resolveTableReference
-
Methods inherited from interface org.hibernate.sql.ast.tree.expression.Expression
createDomainResultSqlSelection, createDomainResultSqlSelection, createSqlSelection, createSqlSelection, getColumnReference
-
Methods inherited from interface org.hibernate.query.sqm.sql.internal.SqmPathInterpretation
getExpressionType, getSqlExpression
-
-
-
-
Method Detail
-
getNavigablePath
NavigablePath getNavigablePath()
- Specified by:
getNavigablePathin interfaceSqmPathInterpretation
-
getGroupAlias
String getGroupAlias()
If we want to use CTE for TableGroup rendering we will need to know the alias we can use for the group
-
getModelPart
ModelPartContainer getModelPart()
-
getSourceAlias
String getSourceAlias()
-
getTableGroupJoins
List<TableGroupJoin> getTableGroupJoins()
-
getNestedTableGroupJoins
List<TableGroupJoin> getNestedTableGroupJoins()
-
canUseInnerJoins
boolean canUseInnerJoins()
-
isLateral
default boolean isLateral()
-
addTableGroupJoin
void addTableGroupJoin(TableGroupJoin join)
-
prependTableGroupJoin
void prependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)
Adds the given table group join before a join as found via the given navigable path.
-
addNestedTableGroupJoin
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 = 1is modeled asTableGroup( 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
-
visitTableGroupJoins
void visitTableGroupJoins(Consumer<TableGroupJoin> consumer)
-
visitNestedTableGroupJoins
void visitNestedTableGroupJoins(Consumer<TableGroupJoin> consumer)
-
getPrimaryTableReference
TableReference getPrimaryTableReference()
-
getTableReferenceJoins
List<TableReferenceJoin> getTableReferenceJoins()
-
createDomainResult
default DomainResult createDomainResult(String resultVariable, DomainResultCreationState creationState)
Description copied from interface:DomainResultProducerProduce the domain query- Specified by:
createDomainResultin interfaceDomainResultProducer
-
applySqlSelections
default void applySqlSelections(DomainResultCreationState creationState)
Description copied from interface:DomainResultProducerUsed 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- Specified by:
applySqlSelectionsin interfaceDomainResultProducer
-
accept
default void accept(SqlAstWalker sqlTreeWalker)
- Specified by:
acceptin interfaceSqlAstNode
-
isRealTableGroup
default boolean isRealTableGroup()
-
isFetched
default boolean isFetched()
-
isInitialized
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.
-
findCompatibleJoin
default TableGroupJoin findCompatibleJoin(TableGroupJoinProducer joinProducer, SqlAstJoinType requestedJoinType)
-
findCompatibleJoinedGroup
default TableGroup findCompatibleJoinedGroup(TableGroupJoinProducer joinProducer, SqlAstJoinType requestedJoinType)
-
findTableGroupJoin
default TableGroupJoin findTableGroupJoin(TableGroup tableGroup)
-
hasRealJoins
default boolean hasRealJoins()
-
-