Class OneToManyTableGroup
java.lang.Object
org.hibernate.sql.ast.tree.from.AbstractColumnReferenceQualifier
org.hibernate.sql.ast.tree.from.OneToManyTableGroup
- All Implemented Interfaces:
org.hibernate.query.sqm.sql.internal.DomainResultProducer, org.hibernate.query.sqm.sql.internal.SqmPathInterpretation, SqlSelectionProducer, Expression, ColumnReferenceQualifier, PluralTableGroup, TableGroup, SqlAstNode
public class OneToManyTableGroup
extends AbstractColumnReferenceQualifier
implements TableGroup, PluralTableGroup
A table group for one-to-many plural attributes.
Delegates by default to the element table group,
but also provides access to the index table group table references.
-
Constructor Summary
ConstructorsConstructorDescriptionOneToManyTableGroup(PluralAttributeMapping pluralAttributeMapping, TableGroup elementTableGroup, SessionFactoryImplementor sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidA 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) booleancreateDomainResult(String resultVariable, DomainResultCreationState creationState) The 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 SessionFactoryImplementorgetTableReference(NavigablePath navigablePath, String tableExpression, boolean resolve) Returns the table reference for the table expression, or null if not found.booleanbooleanvoidprependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join) Adds the given table group join before a join as found via the given navigable path.voidregisterIndexTableGroup(TableGroupJoin indexTableGroupJoin) voidregisterIndexTableGroup(TableGroupJoin indexTableGroupJoin, boolean nested) voidvisitNestedTableGroupJoins(Consumer<TableGroupJoin> consumer) voidvisitTableGroupJoins(Consumer<TableGroupJoin> consumer) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ColumnReferenceQualifier
getTableReference, getTableReference, getTableReference, resolveTableReference, resolveTableReference, resolveTableReferenceMethods inherited from interface Expression
createDomainResultSqlSelection, createSqlSelection, getColumnReferenceMethods inherited from interface PluralTableGroup
getTableGroupMethods inherited from interface org.hibernate.query.sqm.sql.internal.SqmPathInterpretation
getAffectedTableName, getSqlExpressionMethods inherited from interface TableGroup
accept, findCompatibleJoin, findCompatibleJoinedGroup, findTableGroupJoin, findTableReference, hasRealJoins, isInitialized, isLateral, isVirtual
-
Constructor Details
-
OneToManyTableGroup
public OneToManyTableGroup(PluralAttributeMapping pluralAttributeMapping, TableGroup elementTableGroup, SessionFactoryImplementor sessionFactory)
-
-
Method Details
-
getExpressionType
Description copied from interface:ExpressionThe type for this expression- Specified by:
getExpressionTypein interfaceExpression- Specified by:
getExpressionTypein interfaceorg.hibernate.query.sqm.sql.internal.SqmPathInterpretation
-
getModelPart
- Specified by:
getModelPartin interfacePluralTableGroup- Specified by:
getModelPartin interfaceTableGroup
-
getSessionFactory
- Specified by:
getSessionFactoryin classAbstractColumnReferenceQualifier
-
getElementTableGroup
- Specified by:
getElementTableGroupin interfacePluralTableGroup
-
getIndexTableGroup
- Specified by:
getIndexTableGroupin interfacePluralTableGroup
-
registerIndexTableGroup
-
registerIndexTableGroup
-
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
-
getSourceAlias
- Specified by:
getSourceAliasin interfaceTableGroup
-
applyAffectedTableNames
- Specified by:
applyAffectedTableNamesin interfaceTableGroup
-
getPrimaryTableReference
- Specified by:
getPrimaryTableReferencein interfaceTableGroup- Specified by:
getPrimaryTableReferencein classAbstractColumnReferenceQualifier
-
getTableReferenceJoins
- Specified by:
getTableReferenceJoinsin interfaceTableGroup- Specified by:
getTableReferenceJoinsin classAbstractColumnReferenceQualifier
-
getTableGroupJoins
- Specified by:
getTableGroupJoinsin interfaceTableGroup
-
getNestedTableGroupJoins
- Specified by:
getNestedTableGroupJoinsin interfaceTableGroup
-
canUseInnerJoins
public boolean canUseInnerJoins()- Specified by:
canUseInnerJoinsin 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
-
createDomainResult
public DomainResult createDomainResult(String resultVariable, DomainResultCreationState creationState) - Specified by:
createDomainResultin interfaceorg.hibernate.query.sqm.sql.internal.DomainResultProducer- Specified by:
createDomainResultin interfaceTableGroup
-
applySqlSelections
- Specified by:
applySqlSelectionsin interfaceorg.hibernate.query.sqm.sql.internal.DomainResultProducer- Specified by:
applySqlSelectionsin interfaceTableGroup
-
isRealTableGroup
public boolean isRealTableGroup()- Specified by:
isRealTableGroupin interfaceTableGroup
-
isFetched
public boolean isFetched()- Specified by:
isFetchedin interfaceTableGroup
-