Package org.hibernate.sql.ast.tree.from
Class MutatingTableReferenceGroupWrapper
- java.lang.Object
-
- org.hibernate.sql.ast.tree.from.MutatingTableReferenceGroupWrapper
-
- All Implemented Interfaces:
DomainResultProducer,SqmPathInterpretation,SqlSelectionProducer,Expression,ColumnReferenceQualifier,TableGroup,SqlAstNode
public class MutatingTableReferenceGroupWrapper extends Object implements TableGroup
Acts as a TableGroup for DML query operations. It is used to simply wrap the TableReference of the "mutating table"
-
-
Constructor Summary
Constructors Constructor Description MutatingTableReferenceGroupWrapper(NavigablePath navigablePath, ModelPartContainer modelPart, NamedTableReference mutatingTableReference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)booleancanUseInnerJoins()ModelPartgetExpressionType()The type for this expressionStringgetGroupAlias()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()TableReferencegetTableReference(NavigablePath navigablePath, String tableExpression, boolean resolve)Returns the table reference for the table expression, or null if not found.List<TableReferenceJoin>getTableReferenceJoins()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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier
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
getSqlExpression
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroup
accept, applySqlSelections, createDomainResult, findCompatibleJoin, findCompatibleJoinedGroup, findTableGroupJoin, hasRealJoins, isFetched, isInitialized, isLateral, isRealTableGroup
-
-
-
-
Constructor Detail
-
MutatingTableReferenceGroupWrapper
public MutatingTableReferenceGroupWrapper(NavigablePath navigablePath, ModelPartContainer modelPart, NamedTableReference mutatingTableReference)
-
-
Method Detail
-
getNavigablePath
public NavigablePath getNavigablePath()
- Specified by:
getNavigablePathin interfaceSqmPathInterpretation- Specified by:
getNavigablePathin interfaceTableGroup
-
getExpressionType
public ModelPart getExpressionType()
Description copied from interface:ExpressionThe type for this expression- Specified by:
getExpressionTypein interfaceExpression- Specified by:
getExpressionTypein interfaceSqmPathInterpretation
-
getGroupAlias
public String 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
public ModelPartContainer getModelPart()
- Specified by:
getModelPartin interfaceTableGroup
-
getPrimaryTableReference
public TableReference getPrimaryTableReference()
- Specified by:
getPrimaryTableReferencein interfaceTableGroup
-
getTableReference
public TableReference getTableReference(NavigablePath navigablePath, String tableExpression, boolean resolve)
Description copied from interface:ColumnReferenceQualifierReturns the table reference for the table expression, or null if not found.- Specified by:
getTableReferencein interfaceColumnReferenceQualifier- Parameters:
navigablePath- The path for which to look up the table reference, may be nulltableExpression- The table expression for which to look up the table referenceresolve- Whether to potentially create table reference joins for this table group
-
applyAffectedTableNames
public void applyAffectedTableNames(Consumer<String> nameCollector)
- Specified by:
applyAffectedTableNamesin interfaceTableGroup
-
getSourceAlias
public String getSourceAlias()
- Specified by:
getSourceAliasin interfaceTableGroup
-
getTableGroupJoins
public List<TableGroupJoin> getTableGroupJoins()
- Specified by:
getTableGroupJoinsin interfaceTableGroup
-
getNestedTableGroupJoins
public List<TableGroupJoin> getNestedTableGroupJoins()
- Specified by:
getNestedTableGroupJoinsin interfaceTableGroup
-
canUseInnerJoins
public boolean canUseInnerJoins()
- Specified by:
canUseInnerJoinsin interfaceTableGroup
-
addTableGroupJoin
public void addTableGroupJoin(TableGroupJoin join)
- Specified by:
addTableGroupJoinin interfaceTableGroup
-
prependTableGroupJoin
public void prependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)
Description copied from interface:TableGroupAdds the given table group join before a join as found via the given navigable path.- Specified by:
prependTableGroupJoinin interfaceTableGroup
-
addNestedTableGroupJoin
public void addNestedTableGroupJoin(TableGroupJoin join)
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
public void visitTableGroupJoins(Consumer<TableGroupJoin> consumer)
- Specified by:
visitTableGroupJoinsin interfaceTableGroup
-
visitNestedTableGroupJoins
public void visitNestedTableGroupJoins(Consumer<TableGroupJoin> consumer)
- Specified by:
visitNestedTableGroupJoinsin interfaceTableGroup
-
getTableReferenceJoins
public List<TableReferenceJoin> getTableReferenceJoins()
- Specified by:
getTableReferenceJoinsin interfaceTableGroup
-
-