Top Description Inners Methods
org.hibernate.metamodel.mapping

public Interface NonAggregatedIdentifierMapping

extends CompositeIdentifierMapping, EmbeddableValuedFetchable, FetchOptions, VirtualModelPart
Known Direct Implementers
org.hibernate.metamodel.mapping.internal.InverseNonAggregatedIdentifierMapping, org.hibernate.metamodel.mapping.internal.NonAggregatedIdentifierMappingImpl, org.hibernate.query.derived.AnonymousTupleNonAggregatedEntityIdentifierMapping
Imports
org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.util.IndexedConsumer, org.hibernate.metamodel.mapping.internal.IdClassEmbeddable, .VirtualIdEmbeddable, org.hibernate.sql.results.graph.FetchOptions, org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable

A "non-aggregated" composite identifier, which means that the entity itself does not define a singular representation of its identifier like an aggregated mapping does. An IdClass can be used to provide a simple, singular representation of the identifier for easier reference in API calls. JPA requires using an IdClass when mapping such identifiers. Hibernate supports mapping such identifiers with or without the IdClass; without, the entity itself is used as the identifier.
Author
Steve Ebersole
See Also
jakarta.persistence.IdClass, jakarta.persistence.MapsId

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
NonAggregatedIdentifierMapping.IdentifierValueMapper

Think of an AttributeConverter for id values to account for representation difference between virtual and id-class mappings

Method Summary

Modifier and TypeMethod and Description
public default int
public IdClassEmbeddable
getIdClassEmbeddable()

The id-class representation of this id mapping

public NonAggregatedIdentifierMapping.IdentifierValueMapper
getIdentifierValueMapper()

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

public VirtualIdEmbeddable
getVirtualIdEmbeddable()

The virtual-id representation of this id mapping

Inherited from org.hibernate.metamodel.mapping.CompositeIdentifierMapping:
getMappedIdEmbeddableTypeDescriptorgetPartMappingTypegetUnsavedStrategyhasContainingClass
Inherited from org.hibernate.metamodel.mapping.VirtualModelPart:
isVirtual
Inherited from org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable:
getDefaultSqlAstJoinTypeisSimpleJoinPredicate
Inherited from org.hibernate.sql.results.graph.FetchOptions:
valueOf

Method Detail

getFetchableKeyback to summary
public default int getFetchableKey()

Overrides default org.hibernate.metamodel.mapping.CompositeIdentifierMapping.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
getIdClassEmbeddableback to summary
public IdClassEmbeddable getIdClassEmbeddable()

The id-class representation of this id mapping

getIdentifierValueMapperback to summary
public NonAggregatedIdentifierMapping.IdentifierValueMapper getIdentifierValueMapper()

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

getVirtualIdEmbeddableback to summary
public VirtualIdEmbeddable getVirtualIdEmbeddable()

The virtual-id representation of this id mapping

org.hibernate.metamodel.mapping back to summary

public Interface NonAggregatedIdentifierMapping.IdentifierValueMapper

extends EmbeddableMappingType
Known Direct Implementers
org.hibernate.metamodel.mapping.internal.IdClassEmbeddable, org.hibernate.metamodel.mapping.internal.VirtualIdEmbeddable

Think of an AttributeConverter for id values to account for representation difference between virtual and id-class mappings

Method Summary

Modifier and TypeMethod and Description
public default void
forEachAttribute(IndexedConsumer<SingularAttributeMapping> consumer)

Convenience method to iterate the attributes for this mapper's representation

public EmbeddableValuedModelPart
public Object
getIdentifier(Object entity, SharedSessionContractImplementor session)

Extract the identifier out of the given entity, returning the mapper's representation

public void
setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)

Extract the identifier out of the given entity, returning the mapper's representation

Inherited from org.hibernate.metamodel.mapping.EmbeddableMappingType:
anyRequiresAggregateColumnWriterapplySqlSelectionsapplySqlSelectionscomparecreateDomainResultcreateInverseMappingTypeforEachInsertableforEachJdbcTypeforEachSelectableforEachSelectableforEachUpdatablegetAggregateMappinggetEmbeddedValueMappinggetJdbcTypeCountgetJdbcValueCountgetJdbcValueSelectablegetPartMappingTypegetRepresentationStrategygetSelectableIndexisCreateEmptyCompositesEnabledrequiresAggregateColumnWritershouldBindAggregateMappingshouldMutateAggregateMappingshouldSelectAggregateMapping

Method Detail

forEachAttributeback to summary
public default void forEachAttribute(IndexedConsumer<SingularAttributeMapping> consumer)

Convenience method to iterate the attributes for this mapper's representation

getEmbeddedPartback to summary
public EmbeddableValuedModelPart getEmbeddedPart()
getIdentifierback to summary
public Object getIdentifier(Object entity, SharedSessionContractImplementor session)

Extract the identifier out of the given entity, returning the mapper's representation

setIdentifierback to summary
public void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)

Extract the identifier out of the given entity, returning the mapper's representation