Package org.hibernate.sql.ast.tree.from
Class AbstractTableGroup
- java.lang.Object
-
- org.hibernate.sql.ast.tree.from.AbstractColumnReferenceQualifier
-
- org.hibernate.sql.ast.tree.from.AbstractTableGroup
-
- All Implemented Interfaces:
DomainResultProducer
,SqmPathInterpretation
,SqlSelectionProducer
,Expression
,ColumnReferenceQualifier
,TableGroup
,SqlAstNode
- Direct Known Subclasses:
CorrelatedTableGroup
,CteTableGroup
,EmbeddableFunctionTableGroup
,FunctionTableGroup
,QueryPartTableGroup
,StandardTableGroup
,StandardVirtualTableGroup
,TableGroupImpl
,UnionTableGroup
,ValuesTableGroup
public abstract class AbstractTableGroup extends AbstractColumnReferenceQualifier implements TableGroup
-
-
Constructor Summary
Constructors Constructor Description AbstractTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, ModelPartContainer modelPartContainer, String sourceAlias, SqlAliasBase sqlAliasBase, SessionFactoryImplementor sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
addTableGroupJoin(TableGroupJoin join)
boolean
canUseInnerJoins()
ModelPart
getExpressionType()
The type for this expressionString
getGroupAlias()
If we want to use CTE for TableGroup rendering we will need to know the alias we can use for the groupModelPartContainer
getModelPart()
NavigablePath
getNavigablePath()
List<TableGroupJoin>
getNestedTableGroupJoins()
protected SessionFactoryImplementor
getSessionFactory()
String
getSourceAlias()
SqlAliasBase
getSqlAliasBase()
List<TableGroupJoin>
getTableGroupJoins()
boolean
isRealTableGroup()
void
prependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)
Adds the given table group join before a join as found via the given navigable path.String
toString()
void
visitNestedTableGroupJoins(Consumer<TableGroupJoin> consumer)
void
visitTableGroupJoins(Consumer<TableGroupJoin> consumer)
-
Methods inherited from class org.hibernate.sql.ast.tree.from.AbstractColumnReferenceQualifier
getPrimaryTableReference, getTableReference, getTableReferenceJoins
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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, 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, applyAffectedTableNames, applySqlSelections, createDomainResult, findCompatibleJoin, findCompatibleJoinedGroup, findTableGroupJoin, getPrimaryTableReference, getTableReferenceJoins, hasRealJoins, isFetched, isInitialized, isLateral, isVirtual
-
-
-
-
Constructor Detail
-
AbstractTableGroup
public AbstractTableGroup(boolean canUseInnerJoins, NavigablePath navigablePath, ModelPartContainer modelPartContainer, String sourceAlias, SqlAliasBase sqlAliasBase, SessionFactoryImplementor sessionFactory)
-
-
Method Detail
-
getSqlAliasBase
public SqlAliasBase getSqlAliasBase()
-
getNavigablePath
public NavigablePath getNavigablePath()
- Specified by:
getNavigablePath
in interfaceSqmPathInterpretation
- Specified by:
getNavigablePath
in interfaceTableGroup
-
getGroupAlias
public String getGroupAlias()
Description copied from interface:TableGroup
If we want to use CTE for TableGroup rendering we will need to know the alias we can use for the group- Specified by:
getGroupAlias
in interfaceTableGroup
-
getModelPart
public ModelPartContainer getModelPart()
- Specified by:
getModelPart
in interfaceTableGroup
-
getExpressionType
public ModelPart getExpressionType()
Description copied from interface:Expression
The type for this expression- Specified by:
getExpressionType
in interfaceExpression
- Specified by:
getExpressionType
in interfaceSqmPathInterpretation
-
getSourceAlias
public String getSourceAlias()
- Specified by:
getSourceAlias
in interfaceTableGroup
-
getSessionFactory
protected SessionFactoryImplementor getSessionFactory()
- Specified by:
getSessionFactory
in classAbstractColumnReferenceQualifier
-
getTableGroupJoins
public List<TableGroupJoin> getTableGroupJoins()
- Specified by:
getTableGroupJoins
in interfaceTableGroup
-
getNestedTableGroupJoins
public List<TableGroupJoin> getNestedTableGroupJoins()
- Specified by:
getNestedTableGroupJoins
in interfaceTableGroup
-
isRealTableGroup
public boolean isRealTableGroup()
- Specified by:
isRealTableGroup
in interfaceTableGroup
-
canUseInnerJoins
public boolean canUseInnerJoins()
- Specified by:
canUseInnerJoins
in interfaceTableGroup
-
addTableGroupJoin
public void addTableGroupJoin(TableGroupJoin join)
- Specified by:
addTableGroupJoin
in interfaceTableGroup
-
prependTableGroupJoin
public void prependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)
Description copied from interface:TableGroup
Adds the given table group join before a join as found via the given navigable path.- Specified by:
prependTableGroupJoin
in interfaceTableGroup
-
addNestedTableGroupJoin
public void addNestedTableGroupJoin(TableGroupJoin join)
Description copied from interface:TableGroup
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 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:
addNestedTableGroupJoin
in interfaceTableGroup
-
visitTableGroupJoins
public void visitTableGroupJoins(Consumer<TableGroupJoin> consumer)
- Specified by:
visitTableGroupJoins
in interfaceTableGroup
-
visitNestedTableGroupJoins
public void visitNestedTableGroupJoins(Consumer<TableGroupJoin> consumer)
- Specified by:
visitNestedTableGroupJoins
in interfaceTableGroup
-
-