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

public Class NonAggregatedIdentifierMappingImpl

extends AbstractCompositeIdentifierMapping
implements NonAggregatedIdentifierMapping
Class Inheritance
All Implemented Interfaces
org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping, org.hibernate.metamodel.mapping.VirtualModelPart, org.hibernate.metamodel.mapping.ModelPart, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.JdbcMappingContainer, 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.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
Imports
java.util.List, java.util.function.BiConsumer, org.hibernate.cache.MutableCacheKeyBuilder, org.hibernate.engine.FetchTiming, org.hibernate.engine.spi.EntityHolder, .EntityKey, .PersistenceContext, .SharedSessionContractImplementor, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.mapping.Component, .RootClass, org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping, org.hibernate.metamodel.mapping.AttributeMapping, .EmbeddableMappingType, .EntityIdentifierMapping, .JdbcMapping, .ModelPart, .NonAggregatedIdentifierMapping, .SelectableMappings, org.hibernate.persister.entity.EntityPersister, org.hibernate.proxy.HibernateProxy, .LazyInitializer, org.hibernate.query.sqm.sql.SqmToSqlAstConverter, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.Clause, org.hibernate.sql.ast.spi.SqlAstCreationState, .SqlSelection, org.hibernate.sql.ast.tree.expression.ColumnReference, .Expression, .SqlTuple, org.hibernate.sql.ast.tree.from.TableGroup, .TableReference, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, .Fetch, .FetchParent, .Fetchable, org.hibernate.sql.results.graph.embeddable.internal.NonAggregatedIdentifierMappingFetch, .NonAggregatedIdentifierMappingResult

A "non-aggregated" composite identifier. This is an identifier defined using more than one jakarta.persistence.Id attribute with zero-or-more jakarta.persistence.MapsId. Can also be a single jakarta.persistence.Id with jakarta.persistence.MapsId

Field Summary

Modifier and TypeField and Description
private final EntityPersister
private final IdClassEmbeddable
private final NonAggregatedIdentifierMapping.IdentifierValueMapper
private final VirtualIdEmbeddable
Inherited from org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping:
sessionFactory

Constructor Summary

AccessConstructor and Description
public
NonAggregatedIdentifierMappingImpl(EntityPersister entityPersister, RootClass bootEntityDescriptor, String rootTableName, String[] rootTableKeyColumnNames, MappingModelCreationProcess creationProcess)

Method Summary

Modifier and TypeMethod and Description
public void
addToCacheKey(MutableCacheKeyBuilder
the MutableCacheKey used to add the disassembled value and the hashCode
cacheKey
,
Object
the value to disassemble
value
,
SharedSessionContractImplementor
the SharedSessionContractImplementor
session
)

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

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey, org.hibernate.type.descriptor.java.JavaTypedExpressible.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.
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 <X, Y> int
breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

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

Implements org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

Breaks down the domain value to its constituent JDBC values.
public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Overrides org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping.createDomainResult.

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

Create a DomainResult for a specific reference to this ModelPart.
public Object
public <X, Y> int
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)

Overrides org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping.generateFetch.

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

Generates a Fetch of this fetchable
public String
getAttributeName()

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.getAttributeName.

The name of the attribute defining the id, if one
public Fetchable
public String
public IdClassEmbeddable
public Object
getIdentifier(Object entity)

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.getIdentifier.

Extract the identifier from an instance of the entity
public NonAggregatedIdentifierMapping.IdentifierValueMapper
public EmbeddableMappingType
getMappedIdEmbeddableTypeDescriptor()

Implements org.hibernate.metamodel.mapping.CompositeIdentifierMapping.getMappedIdEmbeddableTypeDescriptor.

Returns the embeddable type descriptor of the id-class, if there is one, otherwise the one of the virtual embeddable mapping type.
public EmbeddableMappingType
public EntityIdentifierMapping.Nature
public int
public EmbeddableMappingType
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 VirtualIdEmbeddable
public boolean
public void
setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.setIdentifier.

Inject an identifier value into an instance of the entity
public SqlTuple
Inherited from org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping:
containsTableReferencecreateRootTableGroupJoincreateTableGroupJoinfindContainingEntityMappingfindSubPartgetContainingTableExpressiongetEmbeddableTypeDescriptorgetEntityMappinggetMappedFetchOptionsgetNavigableRolegetStylegetTiminghasPartitionedSelectionMappinginstantiatevisitSubParts

Field Detail

entityDescriptorback to summary
private final EntityPersister entityDescriptor
idClassEmbeddableback to summary
private final IdClassEmbeddable idClassEmbeddable
identifierValueMapperback to summary
private final NonAggregatedIdentifierMapping.IdentifierValueMapper identifierValueMapper
virtualIdEmbeddableback to summary
private final VirtualIdEmbeddable virtualIdEmbeddable

Constructor Detail

NonAggregatedIdentifierMappingImplback to summary
public NonAggregatedIdentifierMappingImpl(EntityPersister entityPersister, RootClass bootEntityDescriptor, String rootTableName, String[] rootTableKeyColumnNames, MappingModelCreationProcess creationProcess)

Method Detail

addToCacheKeyback to summary
public void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)

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

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey, org.hibernate.type.descriptor.java.JavaTypedExpressible.addToCacheKey.

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

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.

Parameters
cacheKey:MutableCacheKeyBuilder

the MutableCacheKey used to add the disassembled value and the hashCode

value:Object

the value to disassemble

session:SharedSessionContractImplementor

the SharedSessionContractImplementor

Annotations
@Override
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
breakDownJdbcValuesback to summary
public <X, Y> int breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

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

Implements org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

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

Breaks down the domain value to its constituent JDBC values. Think of it as breaking the multi-dimensional array into a visitable flat array. Additionally, it passes through the values X and Y to the consumer. Returns the amount of jdbc types that have been visited.

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

Overrides org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping.createDomainResult.

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
disassembleback to summary
public Object disassemble(Object value, SharedSessionContractImplementor session)

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

Implements org.hibernate.metamodel.mapping.Bindable.disassemble.

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

Breaks down a value of J into its simple pieces. E.g., an embedded value gets broken down into an array of its attribute state; a basic value converts to itself; etc.

Generally speaking, this is the form in which entity state is kept relative to a Session via EntityEntry.

@Entity class Person {
    @Id Integer id;
    @Embedded Name name;
    int age;
}

@Embeddable class Name {
    String familiarName;
    String familyName;
}

At the top level, we would want to disassemble a Person value, so we'd ask the Bindable for the Person entity to disassemble. Given a Person value:

Person( id=1, name=Name( 'Steve', 'Ebersole' ), 28 )

this disassemble would result in a multidimensional array:

[ ["Steve", "Ebersole"], 28 ]

Note that the identifier is not part of this disassembled state. Note also how the embedded value results in a sub-array.

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 org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping.forEachJdbcValue.

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)

Overrides org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping.generateFetch.

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
getAttributeNameback to summary
public String getAttributeName()

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.getAttributeName.

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

The name of the attribute defining the id, if one

Annotations
@Override
getFetchableback to summary
public Fetchable getFetchable(int position)

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

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
getIdClassEmbeddableback to summary
public IdClassEmbeddable getIdClassEmbeddable()

Implements org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping.getIdClassEmbeddable.

Doc from org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping.getIdClassEmbeddable.

The id-class representation of this id mapping

Annotations
@Override
getIdentifierback to summary
public Object getIdentifier(Object entity)

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.getIdentifier.

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

Extract the identifier from an instance of the entity

Annotations
@Override
getIdentifierValueMapperback to summary
public NonAggregatedIdentifierMapping.IdentifierValueMapper getIdentifierValueMapper()

Implements org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping.getIdentifierValueMapper.

Doc from org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping.getIdentifierValueMapper.

The id-class, if there is one, otherwise the virtual-id.

Annotations
@Override
getMappedIdEmbeddableTypeDescriptorback to summary
public EmbeddableMappingType getMappedIdEmbeddableTypeDescriptor()

Implements org.hibernate.metamodel.mapping.CompositeIdentifierMapping.getMappedIdEmbeddableTypeDescriptor.

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

Returns the embeddable type descriptor of the id-class, if there is one, otherwise the one of the virtual embeddable mapping type.

Annotations
@Override
getMappedTypeback to summary
public EmbeddableMappingType getMappedType()

Overrides org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping.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
getNatureback to summary
public EntityIdentifierMapping.Nature getNature()

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.getNature.

Annotations
@Override
getNumberOfFetchablesback to summary
public int getNumberOfFetchables()

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

Doc from org.hibernate.sql.results.graph.FetchableContainer.getNumberOfFetchables.

The number of fetchables in the container

Annotations
@Override
getPartMappingTypeback to summary
public EmbeddableMappingType getPartMappingType()

Implements org.hibernate.metamodel.mapping.CompositeIdentifierMapping.getPartMappingType, 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
getVirtualIdEmbeddableback to summary
public VirtualIdEmbeddable getVirtualIdEmbeddable()

Implements org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping.getVirtualIdEmbeddable.

Doc from org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping.getVirtualIdEmbeddable.

The virtual-id representation of this id mapping

Annotations
@Override
hasContainingClassback to summary
public boolean hasContainingClass()

Overrides org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping.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
setIdentifierback to summary
public void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.EntityIdentifierMapping.setIdentifier.

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

Inject an identifier value into an instance of the entity

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

Overrides org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping.toSqlExpression.

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

Annotations
@Override