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

public Class InverseNonAggregatedIdentifierMapping

extends EmbeddedAttributeMapping
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.spi.EntityHolder, .EntityKey, .PersistenceContext, .SharedSessionContractImplementor, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.metamodel.mapping.AttributeMapping, .EmbeddableMappingType, .EntityIdentifierMapping, .EntityMappingType, .JdbcMapping, .ManagedMappingType, .ModelPart, .NonAggregatedIdentifierMapping, .SelectableMappings, org.hibernate.persister.entity.EntityPersister, 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, .TableGroupProducer, .TableReference, org.hibernate.sql.results.graph.DomainResultCreationState, .Fetchable

The inverse part of a "non-aggregated" composite identifier. Exposes the virtual id embeddable as mapping type, which requires the attribute mapping to implement NonAggregatedIdentifierMapping.

Field Summary

Modifier and TypeField and Description
private final EntityMappingType
private final IdClassEmbeddable
private final NonAggregatedIdentifierMapping.IdentifierValueMapper

Constructor Summary

AccessConstructor and Description
pack-priv
InverseNonAggregatedIdentifierMapping(ManagedMappingType keyDeclaringType, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, NonAggregatedIdentifierMapping inverseModelPart, EmbeddableMappingType embeddableTypeDescriptor, 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)

Overrides org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping.applySqlSelections.

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)

Overrides org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping.applySqlSelections.

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 Object
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 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 EntityIdentifierMapping.Nature
public int
public EmbeddableMappingType
public String
public String
getSqlAliasStem()

Overrides org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping.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
hasContainingClass()

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

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

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

Instantiate an instance of the identifier.
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.mapping.internal.EmbeddedAttributeMapping:
asEmbeddedAttributeMappingcomparecontainsTableReferencecreateDomainResultcreateRootTableGroupJoincreateTableGroupJoingenerateFetchgetContainingTableExpressiongetEmbeddableTypeDescriptorgetMappedTypegetNavigableRolegetParentInjectionAttributePropertyAccessisEmbeddedAttributeMappingisSelectabletoString

Field Detail

entityDescriptorback to summary
private final EntityMappingType entityDescriptor
idClassEmbeddableback to summary
private final IdClassEmbeddable idClassEmbeddable
identifierValueMapperback to summary
private final NonAggregatedIdentifierMapping.IdentifierValueMapper identifierValueMapper

Constructor Detail

InverseNonAggregatedIdentifierMappingback to summary
pack-priv InverseNonAggregatedIdentifierMapping(ManagedMappingType keyDeclaringType, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, NonAggregatedIdentifierMapping inverseModelPart, EmbeddableMappingType embeddableTypeDescriptor, 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)

Overrides org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping.applySqlSelections.

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)

Overrides org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping.applySqlSelections.

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
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 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
getFetchableback to summary
public Fetchable getFetchable(int position)

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

Annotations
@Override
getFetchableNameback to summary
public String getFetchableName()

Overrides org.hibernate.metamodel.mapping.internal.AbstractStateArrayContributorMapping.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
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()

Overrides org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping.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
getPartNameback to summary
public String getPartName()

Overrides default org.hibernate.metamodel.mapping.EntityIdentifierMapping.getPartName, org.hibernate.metamodel.mapping.AttributeMapping.getPartName.

Implements org.hibernate.metamodel.mapping.ModelPart.getPartName.

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

The local part name, which is generally the unqualified role name

Annotations
@Override
getSqlAliasStemback to summary
public String getSqlAliasStem()

Overrides org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping.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()

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
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
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.mapping.internal.EmbeddedAttributeMapping.toSqlExpression.

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

Annotations
@Override