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

public abstract Class AbstractCompositeIdentifierMapping

extends Object
implements CompositeIdentifierMapping, 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.CompositeIdentifierMapping, org.hibernate.metamodel.mapping.EntityIdentifierMapping
Known Direct Subclasses
org.hibernate.metamodel.mapping.internal.EmbeddedIdentifierMappingImpl, org.hibernate.metamodel.mapping.internal.NonAggregatedIdentifierMappingImpl
Imports
java.util.List, java.util.function.Consumer, org.hibernate.engine.FetchStyle, .FetchTiming, org.hibernate.engine.spi.SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.metamodel.mapping.AttributeMapping, .CompositeIdentifierMapping, .EmbeddableMappingType, .EntityIdentifierMapping, .EntityMappingType, .ForeignKeyDescriptor, .ModelPart, .SelectableMappings, org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess, .ToOneAttributeMapping, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.query.sqm.sql.SqmToSqlAstConverter, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.Clause, .SqlAstJoinType, org.hibernate.sql.ast.spi.SqlAliasBase, .SqlAstCreationState, org.hibernate.sql.ast.tree.expression.ColumnReference, .Expression, .SqlTuple, org.hibernate.sql.ast.tree.from.StandardVirtualTableGroup, .TableGroup, .TableGroupJoin, .TableReference, org.hibernate.sql.ast.tree.predicate.Predicate, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, .Fetch, .FetchOptions, .FetchParent, org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable, org.hibernate.sql.results.graph.embeddable.internal.EmbeddableFetchImpl, .EmbeddableResultImpl

Base implementation for composite identifier mappings
Author
Andrea Boriero

Field Summary

Modifier and TypeField and Description
private final EntityMappingType
protected final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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 <X, Y> int
forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue, org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.forEachJdbcValue.

Visit each constituent JDBC value extracted from the entity instance itself.
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
protected EntityMappingType
public FetchOptions
public EmbeddableMappingType
public NavigableRole
public FetchStyle
public FetchTiming
public boolean
hasContainingClass()

Implements org.hibernate.metamodel.mapping.CompositeIdentifierMapping.hasContainingClass.

Does the identifier have a corresponding EmbeddableId or IdClass?
public boolean
public Object
instantiate()

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.instantiate.

Instantiate an instance of the identifier.
public SqlTuple
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

entityMappingback to summary
private final EntityMappingType entityMapping
sessionFactoryback to summary
protected final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

tableExpressionback to summary
private final String tableExpression

Constructor Detail

AbstractCompositeIdentifierMappingback to summary
public AbstractCompositeIdentifierMapping(EntityMappingType entityMapping, String tableExpression, MappingModelCreationProcess creationProcess)

Method Detail

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
forEachJdbcValueback to summary
public <X, Y> int forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue, org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.forEachJdbcValue.

Doc from org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue.

Visit each constituent JDBC value extracted from the entity instance itself. Short-hand form of calling disassemble and piping its result to forEachDisassembledJdbcValue(Object, int, JdbcValuesConsumer, SharedSessionContractImplementor)

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
getEntityMappingback to summary
protected EntityMappingType getEntityMapping()
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
getMappedTypeback to summary
public EmbeddableMappingType getMappedType()

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

Implements org.hibernate.metamodel.mapping.ValueMapping.getMappedType.

Doc from org.hibernate.metamodel.mapping.ValueMapping.getMappedType.

Descriptor for the type of this mapping

Annotations
@Override
getNavigableRoleback to summary
public NavigableRole getNavigableRole()

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

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
hasContainingClassback to summary
public boolean hasContainingClass()

Implements org.hibernate.metamodel.mapping.CompositeIdentifierMapping.hasContainingClass.

Doc from org.hibernate.metamodel.mapping.CompositeIdentifierMapping.hasContainingClass.

Does the identifier have a corresponding EmbeddableId or IdClass?

Returns:boolean

false if there is not an IdCass or an EmbeddableId

Annotations
@Override
hasPartitionedSelectionMappingback to summary
public boolean hasPartitionedSelectionMapping()

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

Implements org.hibernate.metamodel.mapping.ModelPart.hasPartitionedSelectionMapping.

Annotations
@Override
instantiateback to summary
public Object instantiate()

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.instantiate.

Doc from org.hibernate.metamodel.mapping.EntityIdentifierMapping.instantiate.

Instantiate an instance of the identifier.

Annotations
@Override
toSqlExpressionback to summary
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)

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

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

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

Annotations
@Override