Top Fields Constructors Methods
org.hibernate.metamodel.mapping.internal

public Class EmbeddedCollectionPart

extends Object
implements CollectionPart, EmbeddableValuedFetchable, FetchOptions
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.results.graph.FetchOptions, org.hibernate.sql.results.graph.FetchStyleAccess, org.hibernate.sql.results.graph.FetchTimingAccess, org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable, org.hibernate.sql.results.graph.Fetchable, org.hibernate.metamodel.mapping.ModelPart, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.metamodel.mapping.EmbeddableValuedModelPart, org.hibernate.sql.ast.tree.from.TableGroupJoinProducer, org.hibernate.sql.ast.tree.from.TableGroupProducer, org.hibernate.metamodel.mapping.ModelPartContainer, org.hibernate.sql.results.graph.FetchableContainer, org.hibernate.metamodel.mapping.ValuedModelPart, org.hibernate.metamodel.mapping.SelectableMappings, org.hibernate.metamodel.mapping.ValueMapping, org.hibernate.type.descriptor.java.JavaTypedExpressible, org.hibernate.metamodel.mapping.CollectionPart
Imports
java.util.ArrayList, .List, java.util.function.BiConsumer, .Consumer, org.hibernate.engine.FetchStyle, .FetchTiming, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.metamodel.mapping.CollectionPart, .EmbeddableMappingType, .EntityMappingType, .JdbcMapping, .MappingType, .ModelPart, .PluralAttributeMapping, .SelectableConsumer, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.persister.collection.CollectionPersister, org.hibernate.property.access.internal.PropertyAccessStrategyBasicImpl, org.hibernate.property.access.spi.PropertyAccess, org.hibernate.query.sqm.sql.SqmToSqlAstConverter, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.Clause, .SqlAstJoinType, org.hibernate.sql.ast.spi.FromClauseAccess, .SqlAliasBase, .SqlAstCreationState, .SqlExpressionResolver, .SqlSelection, org.hibernate.sql.ast.tree.expression.Expression, .SqlTuple, org.hibernate.sql.ast.tree.from.PluralTableGroup, .StandardVirtualTableGroup, .TableGroup, .TableGroupJoin, .TableGroupProducer, .TableReference, org.hibernate.sql.ast.tree.predicate.Predicate, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, .Fetch, .FetchOptions, .FetchParent, .Fetchable, org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable, org.hibernate.sql.results.graph.embeddable.internal.EmbeddableFetchImpl, .EmbeddableResultImpl, org.hibernate.type.descriptor.java.JavaType

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final CollectionPersister
private final String
private final EmbeddableMappingType
private final CollectionPart.Nature
private final PropertyAccess
private final String

Constructor Summary

AccessConstructor and Description
public
EmbeddedCollectionPart(CollectionPersister collectionDescriptor, CollectionPart.Nature nature, EmbeddableMappingType embeddableMappingType, String parentInjectionAttributeName, String containingTableExpression, String sqlAliasStem)

Method Summary

Modifier and TypeMethod and Description
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public boolean
public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for a specific reference to this ModelPart.
public TableGroup
createRootTableGroupJoin(NavigablePath
The NavigablePath to the join
navigablePath
,
TableGroup
The join's (L)eft-(H)and (S)ide
lhs
,
String explicitSourceAlias, SqlAliasBase
A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState
explicitSqlAliasBase
,
SqlAstJoinType
An explicit join-type. May be null to signal that the join is for an implicit path.
sqlAstJoinType
,
boolean fetched, Consumer<Predicate>
Consumer for additional predicates from the producer's mapping.
predicateConsumer
,
SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createRootTableGroupJoin.

Create the "join", but return a TableGroup.
public TableGroupJoin
createTableGroupJoin(NavigablePath
The NavigablePath to the join
navigablePath
,
TableGroup
The join's (L)eft-(H)and (S)ide
lhs
,
String explicitSourceAlias, SqlAliasBase
A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState
explicitSqlAliasBase
,
SqlAstJoinType
An explicit join-type. May be null to signal that the join is for an implicit path.
requestedJoinType
,
boolean fetched, boolean
Indicates there are explicit, additional predicates (from an SQM tree ON/WITH clause)
addsPredicate
,
SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createTableGroupJoin.

Create a TableGroupJoin.
public EntityMappingType
public ModelPart
public Fetch
generateFetch(FetchParent
The parent of the Fetch we are generating
fetchParent
,
NavigablePath
The overall path within the graph
fetchablePath
,
FetchTiming
The requested fetch timing
fetchTiming
,
boolean selected, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.sql.results.graph.Fetchable.generateFetch.

Generates a Fetch of this fetchable
public String
getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

The table which contains the columns mapped by this value
public EmbeddableMappingType
public JavaType<?>
public int
public String
public FetchOptions
public CollectionPart.Nature
public NavigableRole
public PropertyAccess
public MappingType
public String
getSqlAliasStem()

Implements org.hibernate.sql.ast.tree.from.TableGroupProducer.getSqlAliasStem.

Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generated

Note that this is a metadata-ive value.

public FetchStyle
public FetchTiming
private TableGroup
public SqlTuple
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

collectionDescriptorback to summary
private final CollectionPersister collectionDescriptor
containingTableExpressionback to summary
private final String containingTableExpression
embeddableMappingTypeback to summary
private final EmbeddableMappingType embeddableMappingType
natureback to summary
private final CollectionPart.Nature nature
parentInjectionAttributePropertyAccessback to summary
private final PropertyAccess parentInjectionAttributePropertyAccess
sqlAliasStemback to summary
private final String sqlAliasStem

Constructor Detail

EmbeddedCollectionPartback to summary
public EmbeddedCollectionPart(CollectionPersister collectionDescriptor, CollectionPart.Nature nature, EmbeddableMappingType embeddableMappingType, String parentInjectionAttributeName, String containingTableExpression, String sqlAliasStem)

Method Detail

applySqlSelectionsback to summary
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Doc from org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

Annotations
@Override
applySqlSelectionsback to summary
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Doc from org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

Annotations
@Override
containsTableReferenceback to summary
public boolean containsTableReference(String tableExpression)

Overrides default org.hibernate.sql.ast.tree.from.TableGroupProducer.containsTableReference.

Annotations
@Override
createDomainResultback to summary
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Doc from org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for a specific reference to this ModelPart.

Annotations
@Override
createRootTableGroupJoinback to summary
public TableGroup createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType sqlAstJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createRootTableGroupJoin.

Doc from org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createRootTableGroupJoin.

Create the "join", but return a TableGroup. Intended for creating sub-query correlations. E.g., given

    from SomeEntity e
    where exists (
        select 1
        from AnotherEntity a
        where e.association.attr = 1
    )
We call this for the `e.association` path.
Parameters
navigablePath:NavigablePath

The NavigablePath to the join

lhs:TableGroup

The join's (L)eft-(H)and (S)ide

explicitSqlAliasBase:SqlAliasBase

A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState

sqlAstJoinType:SqlAstJoinType

An explicit join-type. May be null to signal that the join is for an implicit path.

predicateConsumer:Consumer<Predicate>

Consumer for additional predicates from the producer's mapping.

Annotations
@Override
createTableGroupJoinback to summary
public TableGroupJoin createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createTableGroupJoin.

Doc from org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createTableGroupJoin.

Create a TableGroupJoin.

Parameters
navigablePath:NavigablePath

The NavigablePath to the join

lhs:TableGroup

The join's (L)eft-(H)and (S)ide

explicitSqlAliasBase:SqlAliasBase

A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState

requestedJoinType:SqlAstJoinType

An explicit join-type. May be null to signal that the join is for an implicit path.

addsPredicate:boolean

Indicates there are explicit, additional predicates (from an SQM tree ON/WITH clause)

Annotations
@Override
findContainingEntityMappingback to summary
public EntityMappingType findContainingEntityMapping()

Implements org.hibernate.metamodel.mapping.ModelPart.findContainingEntityMapping.

Annotations
@Override
findSubPartback to summary
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)

Overrides default org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.findSubPart.

Annotations
@Override
generateFetchback to summary
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.sql.results.graph.Fetchable.generateFetch.

Doc from org.hibernate.sql.results.graph.Fetchable.generateFetch.

Generates a Fetch of this fetchable

Parameters
fetchParent:FetchParent

The parent of the Fetch we are generating

fetchablePath:NavigablePath

The overall path within the graph

fetchTiming:FetchTiming

The requested fetch timing

Annotations
@Override
getContainingTableExpressionback to summary
public String getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

Doc from org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

The table which contains the columns mapped by this value

Annotations
@Override
getEmbeddableTypeDescriptorback to summary
public EmbeddableMappingType getEmbeddableTypeDescriptor()

Implements org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.getEmbeddableTypeDescriptor.

Annotations
@Override
getExpressibleJavaTypeback to summary
public JavaType<?> getExpressibleJavaType()

Overrides default org.hibernate.metamodel.mapping.ValueMapping.getExpressibleJavaType.

Implements org.hibernate.type.descriptor.java.JavaTypedExpressible.getExpressibleJavaType.

Annotations
@Override
getFetchableKeyback to summary
public int getFetchableKey()

Implements org.hibernate.sql.results.graph.Fetchable.getFetchableKey.

Doc from org.hibernate.sql.results.graph.Fetchable.getFetchableKey.

The key that identifies this Fetchable within a FetchableContainer. If this Fetchable is part of FetchableContainer#visitFetchables(IndexedConsumer, EntityMappingType), the values is guaranteed to be between 0 (inclusive) and FetchableContainer#getNumberOfFetchableKeys() (exclusive). Other Fetchable objects may have a special negative value.

The main intent of this key is to index e.g. Fetch objects in an array.

Annotations
@Override
getFetchableNameback to summary
public String getFetchableName()

Implements org.hibernate.sql.results.graph.Fetchable.getFetchableName.

Doc from org.hibernate.sql.results.graph.Fetchable.getFetchableName.

The name of the fetchable. This is the part's "local name".

Annotations
@Override
getMappedFetchOptionsback to summary
public FetchOptions getMappedFetchOptions()

Implements org.hibernate.sql.results.graph.Fetchable.getMappedFetchOptions.

Doc from org.hibernate.sql.results.graph.Fetchable.getMappedFetchOptions.

The configured fetch timing and style

Annotations
@Override
getNatureback to summary
public CollectionPart.Nature getNature()

Implements org.hibernate.metamodel.mapping.CollectionPart.getNature.

Annotations
@Override
getNavigableRoleback to summary
public NavigableRole getNavigableRole()

Implements org.hibernate.metamodel.mapping.ModelPart.getNavigableRole.

Annotations
@Override
getParentInjectionAttributePropertyAccessback to summary
public PropertyAccess getParentInjectionAttributePropertyAccess()

Overrides default org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.getParentInjectionAttributePropertyAccess.

Annotations
@Override
getPartMappingTypeback to summary
public MappingType getPartMappingType()

Implements org.hibernate.metamodel.mapping.ModelPart.getPartMappingType.

Doc from org.hibernate.metamodel.mapping.ModelPart.getPartMappingType.

The type for this part.

Annotations
@Override
getSqlAliasStemback to summary
public String getSqlAliasStem()

Implements org.hibernate.sql.ast.tree.from.TableGroupProducer.getSqlAliasStem.

Doc from org.hibernate.sql.ast.tree.from.TableGroupProducer.getSqlAliasStem.

Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generated

Note that this is a metadata-ive value. It is only ever used internal to the producer producing its TableGroup.

Annotations
@Override
getStyleback to summary
public FetchStyle getStyle()

Implements org.hibernate.sql.results.graph.FetchStyleAccess.getStyle.

Annotations
@Override
getTimingback to summary
public FetchTiming getTiming()

Implements org.hibernate.sql.results.graph.FetchTimingAccess.getTiming.

Annotations
@Override
resolveTableGroupback to summary
private TableGroup resolveTableGroup(NavigablePath fetchablePath, DomainResultCreationState creationState)
toSqlExpressionback to summary
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)

Implements org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.toSqlExpression.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
visitSubPartsback to summary
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)

Overrides default org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.visitSubParts.

Annotations
@Override