Package org.hibernate.sql.ast.tree.from
Class DelegatingTableGroup
java.lang.Object
org.hibernate.sql.ast.tree.from.DelegatingTableGroup
- All Implemented Interfaces:
DomainResultProducer,SqmPathInterpretation,SqlSelectionProducer,Expression,ColumnReferenceQualifier,TableGroup,SqlAstNode
- Direct Known Subclasses:
LazyTableGroup,MappedByTableGroup
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(SqlAstWalker sqlTreeWalker) voidA 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.voidvoidapplyAffectedTableNames(Consumer<String> nameCollector) voidapplySqlSelections(DomainResultCreationState creationState) Used when this producer is a selection in a sub-query.booleancreateDomainResult(String resultVariable, DomainResultCreationState creationState) Produce the domain querycreateSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType javaType, boolean virtual, TypeConfiguration typeConfiguration) Create a SqlSelection for the given JDBC ResultSet positionThe type for this expressionIf we want to use CTE for TableGroup rendering we will need to know the alias we can use for the groupprotected abstract TableGroupgetTableReference(NavigablePath navigablePath, String tableExpression, boolean resolve) Returns the table reference for the table expression, or null if not found.getTableReference(NavigablePath navigablePath, ValuedModelPart modelPart, String tableExpression, boolean resolve) booleanbooleanIf 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.booleanbooleanvoidprependTableGroupJoin(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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier
getTableReference, getTableReference, resolveTableReference, resolveTableReference, resolveTableReferenceMethods inherited from interface org.hibernate.sql.ast.tree.expression.Expression
createDomainResultSqlSelectionMethods inherited from interface org.hibernate.query.sqm.sql.internal.SqmPathInterpretation
getAffectedTableNameMethods inherited from interface org.hibernate.sql.ast.tree.from.TableGroup
findCompatibleJoin, findCompatibleJoinedGroup, findTableGroupJoin, findTableReference, hasRealJoins, isVirtual
-
Constructor Details
-
DelegatingTableGroup
public DelegatingTableGroup()
-
-
Method Details
-
getTableGroup
-
getExpressionType
Description copied from interface:ExpressionThe type for this expression- Specified by:
getExpressionTypein interfaceExpression- Specified by:
getExpressionTypein interfaceSqmPathInterpretation
-
getSqlExpression
- Specified by:
getSqlExpressionin interfaceSqmPathInterpretation
-
getColumnReference
- Specified by:
getColumnReferencein interfaceExpression
-
createSqlSelection
public SqlSelection createSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType javaType, boolean virtual, TypeConfiguration typeConfiguration) Description copied from interface:SqlSelectionProducerCreate a SqlSelection for the given JDBC ResultSet position- Specified by:
createSqlSelectionin interfaceExpression- Specified by:
createSqlSelectionin interfaceSqlSelectionProducer- Parameters:
jdbcPosition- The index position used to read values from JDBCvaluesArrayPosition- The position in our "current JDBC values array"javaType- The descriptor for the Java type to read the value asvirtual- Whether the select is virtual or real. SeeSqlSelection.isVirtual()typeConfiguration- The associated TypeConfiguration
-
getGroupAlias
Description copied from interface:TableGroupIf we want to use CTE for TableGroup rendering we will need to know the alias we can use for the group- Specified by:
getGroupAliasin interfaceTableGroup
-
getModelPart
- Specified by:
getModelPartin interfaceTableGroup
-
getSourceAlias
- Specified by:
getSourceAliasin interfaceTableGroup
-
getTableGroupJoins
- Specified by:
getTableGroupJoinsin interfaceTableGroup
-
getNestedTableGroupJoins
- Specified by:
getNestedTableGroupJoinsin interfaceTableGroup
-
canUseInnerJoins
public boolean canUseInnerJoins()- Specified by:
canUseInnerJoinsin interfaceTableGroup
-
isLateral
public boolean isLateral()- Specified by:
isLateralin interfaceTableGroup
-
addTableGroupJoin
- Specified by:
addTableGroupJoinin interfaceTableGroup
-
addNestedTableGroupJoin
Description copied from interface:TableGroupA 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- Specified by:
addNestedTableGroupJoinin interfaceTableGroup
-
visitTableGroupJoins
- Specified by:
visitTableGroupJoinsin interfaceTableGroup
-
visitNestedTableGroupJoins
- Specified by:
visitNestedTableGroupJoinsin interfaceTableGroup
-
applyAffectedTableNames
- Specified by:
applyAffectedTableNamesin interfaceTableGroup
-
getPrimaryTableReference
- Specified by:
getPrimaryTableReferencein interfaceTableGroup
-
getTableReferenceJoins
- Specified by:
getTableReferenceJoinsin interfaceTableGroup
-
createDomainResult
public DomainResult createDomainResult(String resultVariable, DomainResultCreationState creationState) Description copied from interface:DomainResultProducerProduce the domain query- Specified by:
createDomainResultin interfaceDomainResultProducer- Specified by:
createDomainResultin interfaceTableGroup
-
applySqlSelections
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- Specified by:
applySqlSelectionsin interfaceTableGroup
-
accept
- Specified by:
acceptin interfaceSqlAstNode- Specified by:
acceptin interfaceTableGroup
-
isRealTableGroup
public boolean isRealTableGroup()- Specified by:
isRealTableGroupin interfaceTableGroup
-
isFetched
public boolean isFetched()- Specified by:
isFetchedin interfaceTableGroup
-
isInitialized
public boolean isInitialized()Description copied from interface:TableGroupIf 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.- Specified by:
isInitializedin interfaceTableGroup
-