Top Constructors Methods
org.hibernate.sql.ast.tree.from

public abstract Class DelegatingTableGroup

extends Object
implements TableGroup
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.ast.tree.from.TableGroup, org.hibernate.query.sqm.sql.internal.DomainResultProducer, org.hibernate.query.sqm.sql.internal.SqmPathInterpretation, org.hibernate.sql.ast.tree.expression.Expression, org.hibernate.sql.ast.spi.SqlSelectionProducer, org.hibernate.sql.ast.tree.SqlAstNode, org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier
Known Direct Subclasses
org.hibernate.sql.ast.tree.from.LazyTableGroup, org.hibernate.sql.ast.tree.from.MappedByTableGroup
Imports
java.util.List, java.util.function.Consumer, org.hibernate.metamodel.mapping.ModelPart, .ModelPartContainer, .ValuedModelPart, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.SqlAstWalker, org.hibernate.sql.ast.spi.SqlSelection, org.hibernate.sql.ast.tree.expression.ColumnReference, .Expression, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, org.hibernate.type.descriptor.java.JavaType, org.hibernate.type.spi.TypeConfiguration

Author
Christian Beikov

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
addNestedTableGroupJoin(TableGroupJoin join)

Implements org.hibernate.sql.ast.tree.from.TableGroup.addNestedTableGroupJoin.

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 as TableGroup( 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
public void
public void
public void
applySqlSelections(DomainResultCreationState creationState)

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.applySqlSelections.

Used when this producer is a selection in a sub-query.
public boolean
public DomainResult<J>
createDomainResult(String resultVariable, DomainResultCreationState creationState)

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.createDomainResult.

Produce the domain query
public SqlSelection
createSqlSelection(int
The index position used to read values from JDBC
jdbcPosition
,
int
The position in our "current JDBC values array"
valuesArrayPosition
,
JavaType<T>
The descriptor for the Java type to read the value as
javaType
,
TypeConfiguration
The associated TypeConfiguration
typeConfiguration
)

Overrides default org.hibernate.sql.ast.tree.expression.Expression.createSqlSelection.

Create a SqlSelection for the given JDBC ResultSet position
public SqlSelection
createSqlSelection(int
The index position used to read values from JDBC
jdbcPosition
,
int
The position in our "current JDBC values array"
valuesArrayPosition
,
JavaType<T>
The descriptor for the Java type to read the value as
javaType
,
boolean
Whether the select is virtual or real. See SqlSelection#isVirtual()
virtual
,
TypeConfiguration
The associated TypeConfiguration
typeConfiguration
)

Overrides default org.hibernate.sql.ast.tree.expression.Expression.createSqlSelection.

Create a SqlSelection for the given JDBC ResultSet position
public ColumnReference
public ModelPart
public String
getGroupAlias()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getGroupAlias.

If we want to use CTE for TableGroup rendering we will need to know the alias we can use for the group
public ModelPartContainer
public NavigablePath
public List<TableGroupJoin>
public TableReference
public String
public Expression
protected abstract TableGroup
public List<TableGroupJoin>
public TableReference
getTableReference(NavigablePath
The path for which to look up the table reference, may be null
navigablePath
,
String
The table expression for which to look up the table reference
tableExpression
,
boolean
Whether to potentially create table reference joins for this table group
resolve
)

Implements org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier.getTableReference.

Returns the table reference for the table expression, or null if not found.
public TableReference
public List<TableReferenceJoin>
public boolean
public boolean
isInitialized()

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.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.
public boolean
public boolean
public void
prependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)

Implements org.hibernate.sql.ast.tree.from.TableGroup.prependTableGroupJoin.

Adds the given table group join before a join as found via the given navigable path.
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DelegatingTableGroupback to summary
public DelegatingTableGroup()

Method Detail

acceptback to summary
public void accept(SqlAstWalker sqlTreeWalker)

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.accept.

Annotations
@Override
addNestedTableGroupJoinback to summary
public void addNestedTableGroupJoin(TableGroupJoin join)

Implements org.hibernate.sql.ast.tree.from.TableGroup.addNestedTableGroupJoin.

Doc from org.hibernate.sql.ast.tree.from.TableGroup.addNestedTableGroupJoin.

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 as TableGroup( 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

Annotations
@Override
addTableGroupJoinback to summary
public void addTableGroupJoin(TableGroupJoin join)

Implements org.hibernate.sql.ast.tree.from.TableGroup.addTableGroupJoin.

Annotations
@Override
applyAffectedTableNamesback to summary
public void applyAffectedTableNames(Consumer<String> nameCollector)

Implements org.hibernate.sql.ast.tree.from.TableGroup.applyAffectedTableNames.

Annotations
@Override
applySqlSelectionsback to summary
public void applySqlSelections(DomainResultCreationState creationState)

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.applySqlSelections.

Doc from org.hibernate.query.sqm.sql.internal.DomainResultProducer.applySqlSelections.

Used 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

Annotations
@Override
canUseInnerJoinsback to summary
public boolean canUseInnerJoins()

Implements org.hibernate.sql.ast.tree.from.TableGroup.canUseInnerJoins.

Annotations
@Override
createDomainResultback to summary
public DomainResult<J> createDomainResult(String resultVariable, DomainResultCreationState creationState)

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.createDomainResult.

Doc from org.hibernate.query.sqm.sql.internal.DomainResultProducer.createDomainResult.

Produce the domain query

Annotations
@Override
createSqlSelectionback to summary
public SqlSelection createSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType<T> javaType, TypeConfiguration typeConfiguration)

Overrides default org.hibernate.sql.ast.tree.expression.Expression.createSqlSelection.

Doc from org.hibernate.sql.ast.spi.SqlSelectionProducer.createSqlSelection.

Create a SqlSelection for the given JDBC ResultSet position

Parameters
jdbcPosition:int

The index position used to read values from JDBC

valuesArrayPosition:int

The position in our "current JDBC values array"

javaType:JavaType<T>

The descriptor for the Java type to read the value as

typeConfiguration:TypeConfiguration

The associated TypeConfiguration

Annotations
@Override
createSqlSelectionback to summary
public SqlSelection createSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType<T> javaType, boolean virtual, TypeConfiguration typeConfiguration)

Overrides default org.hibernate.sql.ast.tree.expression.Expression.createSqlSelection.

Doc from org.hibernate.sql.ast.spi.SqlSelectionProducer.createSqlSelection.

Create a SqlSelection for the given JDBC ResultSet position

Parameters
jdbcPosition:int

The index position used to read values from JDBC

valuesArrayPosition:int

The position in our "current JDBC values array"

javaType:JavaType<T>

The descriptor for the Java type to read the value as

virtual:boolean

Whether the select is virtual or real. See SqlSelection#isVirtual()

typeConfiguration:TypeConfiguration

The associated TypeConfiguration

Annotations
@Override
getColumnReferenceback to summary
public ColumnReference getColumnReference()

Overrides default org.hibernate.sql.ast.tree.expression.Expression.getColumnReference.

Annotations
@Override
getExpressionTypeback to summary
public ModelPart getExpressionType()

Implements org.hibernate.query.sqm.sql.internal.SqmPathInterpretation.getExpressionType.

Doc from org.hibernate.sql.ast.tree.expression.Expression.getExpressionType.

The type for this expression

Annotations
@Override
getGroupAliasback to summary
public String getGroupAlias()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getGroupAlias.

Doc from org.hibernate.sql.ast.tree.from.TableGroup.getGroupAlias.

If we want to use CTE for TableGroup rendering we will need to know the alias we can use for the group

Annotations
@Override
getModelPartback to summary
public ModelPartContainer getModelPart()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getModelPart.

Annotations
@Override
getNavigablePathback to summary
public NavigablePath getNavigablePath()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getNavigablePath.

Annotations
@Override
getNestedTableGroupJoinsback to summary
public List<TableGroupJoin> getNestedTableGroupJoins()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getNestedTableGroupJoins.

Annotations
@Override
getPrimaryTableReferenceback to summary
public TableReference getPrimaryTableReference()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getPrimaryTableReference.

Annotations
@Override
getSourceAliasback to summary
public String getSourceAlias()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getSourceAlias.

Annotations
@Override
getSqlExpressionback to summary
public Expression getSqlExpression()

Overrides default org.hibernate.query.sqm.sql.internal.SqmPathInterpretation.getSqlExpression.

Annotations
@Override
getTableGroupback to summary
protected abstract TableGroup getTableGroup()
getTableGroupJoinsback to summary
public List<TableGroupJoin> getTableGroupJoins()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getTableGroupJoins.

Annotations
@Override
getTableReferenceback to summary
public TableReference getTableReference(NavigablePath navigablePath, String tableExpression, boolean resolve)

Implements org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier.getTableReference.

Doc from org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier.getTableReference.

Returns the table reference for the table expression, or null if not found.

Parameters
navigablePath:NavigablePath

The path for which to look up the table reference, may be null

tableExpression:String

The table expression for which to look up the table reference

resolve:boolean

Whether to potentially create table reference joins for this table group

Annotations
@Override
getTableReferenceback to summary
public TableReference getTableReference(NavigablePath navigablePath, ValuedModelPart modelPart, String tableExpression, boolean resolve)

Overrides default org.hibernate.sql.ast.tree.from.ColumnReferenceQualifier.getTableReference.

Annotations
@Override
getTableReferenceJoinsback to summary
public List<TableReferenceJoin> getTableReferenceJoins()

Implements org.hibernate.sql.ast.tree.from.TableGroup.getTableReferenceJoins.

Annotations
@Override
isFetchedback to summary
public boolean isFetched()

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.isFetched.

Annotations
@Override
isInitializedback to summary
public boolean isInitialized()

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.isInitialized.

Doc from org.hibernate.sql.ast.tree.from.TableGroup.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.

Annotations
@Override
isLateralback to summary
public boolean isLateral()

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.isLateral.

Annotations
@Override
isRealTableGroupback to summary
public boolean isRealTableGroup()

Overrides default org.hibernate.sql.ast.tree.from.TableGroup.isRealTableGroup.

Annotations
@Override
prependTableGroupJoinback to summary
public void prependTableGroupJoin(NavigablePath navigablePath, TableGroupJoin join)

Implements org.hibernate.sql.ast.tree.from.TableGroup.prependTableGroupJoin.

Doc from org.hibernate.sql.ast.tree.from.TableGroup.prependTableGroupJoin.

Adds the given table group join before a join as found via the given navigable path.

Annotations
@Override
visitNestedTableGroupJoinsback to summary
public void visitNestedTableGroupJoins(Consumer<TableGroupJoin> consumer)

Implements org.hibernate.sql.ast.tree.from.TableGroup.visitNestedTableGroupJoins.

Annotations
@Override
visitTableGroupJoinsback to summary
public void visitTableGroupJoins(Consumer<TableGroupJoin> consumer)

Implements org.hibernate.sql.ast.tree.from.TableGroup.visitTableGroupJoins.

Annotations
@Override