Class InverseNonAggregatedIdentifierMapping
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping
-
- org.hibernate.metamodel.mapping.internal.AbstractStateArrayContributorMapping
-
- org.hibernate.metamodel.mapping.internal.AbstractSingularAttributeMapping
-
- org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping
-
- org.hibernate.metamodel.mapping.internal.InverseNonAggregatedIdentifierMapping
-
- All Implemented Interfaces:
AttributeMapping
,Bindable
,CompositeIdentifierMapping
,EmbeddableValuedModelPart
,EntityIdentifierMapping
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,ModelPartContainer
,NonAggregatedIdentifierMapping
,OwnedValuedModelPart
,PropertyBasedMapping
,SelectableMappings
,SingularAttributeMapping
,ValuedModelPart
,ValueMapping
,VirtualModelPart
,TableGroupJoinProducer
,TableGroupProducer
,DatabaseSnapshotContributor
,EmbeddableValuedFetchable
,Fetchable
,FetchableContainer
,FetchOptions
,FetchStyleAccess
,FetchTimingAccess
,JavaTypedExpressible
,MutabilityPlanExposer
public class InverseNonAggregatedIdentifierMapping extends EmbeddedAttributeMapping implements NonAggregatedIdentifierMapping
The inverse part of a "non-aggregated" composite identifier. Exposes the virtual id embeddable as mapping type, which requires the attribute mapping to implementNonAggregatedIdentifierMapping
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,Y>, Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
EntityIdentifierMapping.Nature
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping
NonAggregatedIdentifierMapping.IdentifierValueMapper
-
-
Field Summary
-
Fields inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
ID_ROLE_NAME, LEGACY_ID_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)
Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.boolean
areEqual(@Nullable Object one, @Nullable Object other, SharedSessionContractImplementor session)
<X,Y>
intbreakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Breaks down the domain value to its constituent JDBC values.Object
disassemble(Object value, SharedSessionContractImplementor session)
Breaks down a value ofJ
into its simple pieces.<X,Y>
intforEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)
Visit each constituent JDBC value extracted from the entity instance itself.Fetchable
getFetchable(int position)
String
getFetchableName()
The name of the fetchable.IdClassEmbeddable
getIdClassEmbeddable()
The id-class representation of this id mappingObject
getIdentifier(Object entity)
Extract the identifier from an instance of the entityObject
getIdentifier(Object entity, MergeContext mergeContext)
Extract the identifier from an instance of the entity It's supposed to be use during the merging processNonAggregatedIdentifierMapping.IdentifierValueMapper
getIdentifierValueMapper()
The id-class, if there is one, otherwise the virtual-id.EmbeddableMappingType
getMappedIdEmbeddableTypeDescriptor()
Returns the embeddable type descriptor of the id-class, if there is one, otherwise the one of the virtual embeddable mapping type.EntityIdentifierMapping.Nature
getNature()
int
getNumberOfFetchables()
The number of fetchables in the containerEmbeddableMappingType
getPartMappingType()
The type for this part.String
getPartName()
The local part name, which is generally the unqualified role nameString
getSqlAliasStem()
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedVirtualIdEmbeddable
getVirtualIdEmbeddable()
The virtual-id representation of this id mappingboolean
hasContainingClass()
Does the identifier have a corresponding EmbeddableId or IdClass?Object
instantiate()
Instantiate an instance of the identifier.void
setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
Inject an identifier value into an instance of the entitySqlTuple
toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping
asEmbeddedAttributeMapping, compare, containsTableReference, createDomainResult, createRootTableGroupJoin, createTableGroupJoin, generateFetch, getContainingTableExpression, getEmbeddableTypeDescriptor, getMappedType, getNavigableRole, getParentInjectionAttributePropertyAccess, isEmbeddedAttributeMapping, isSelectable, toString
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractSingularAttributeMapping
getGenerator
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractStateArrayContributorMapping
getMappedFetchOptions, getStyle, getTiming
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping
getAttributeMetadata, getAttributeName, getDeclaringType, getFetchableKey, getJavaType, getPropertyAccess, getStateArrayPosition
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.AttributeMapping
asAttributeMapping, asPluralAttributeMapping, findContainingEntityMapping, getAttributeMetadata, getAttributeName, getDeclaringType, getExposedMutabilityPlan, getPropertyAccess, getStateArrayPosition, getValue, isPluralAttributeMapping, setValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.CompositeIdentifierMapping
getUnsavedStrategy
-
Methods inherited from interface org.hibernate.sql.results.graph.DatabaseSnapshotContributor
createSnapshotDomainResult
-
Methods inherited from interface org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable
getDefaultSqlAstJoinType, isSimpleJoinPredicate
-
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableValuedModelPart
decompose, findSubPart, forEachDisassembledJdbcValue, forEachInsertable, forEachJdbcType, forEachSelectable, forEachSubPart, forEachUpdatable, getEmbeddableTypeDescriptor, getJavaType, getJdbcMapping, getJdbcTypeCount, getMappedType, getParentInjectionAttributePropertyAccess, getSelectable, getSelectableIndex, hasPartitionedSelectionMapping, visitSubParts
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
getAttributeName, getIdentifierIfNotUnsaved, isEntityIdentifierMapping
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
generateFetch, getMappedFetchOptions, incrementFetchDepth, isSelectable, resolveCircularFetch
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchStyleAccess
getStyle
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchTimingAccess
getTiming
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, createDomainResult, decompose, getNavigableRole
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping
getFetchableKey
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
createRootTableGroupJoin, createTableGroupJoin, determineSqlJoinType
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachNonFormula, forEachSelectable, getContainingTableExpression, getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
Methods inherited from interface org.hibernate.metamodel.mapping.VirtualModelPart
isVirtual
-
-
-
-
Method Detail
-
instantiate
public Object instantiate()
Description copied from interface:EntityIdentifierMapping
Instantiate an instance of the identifier.- Specified by:
instantiate
in interfaceEntityIdentifierMapping
-
getPartName
public String getPartName()
Description copied from interface:ModelPart
The local part name, which is generally the unqualified role name- Specified by:
getPartName
in interfaceAttributeMapping
- Specified by:
getPartName
in interfaceEntityIdentifierMapping
- Specified by:
getPartName
in interfaceModelPart
-
getNature
public EntityIdentifierMapping.Nature getNature()
- Specified by:
getNature
in interfaceEntityIdentifierMapping
- See Also:
EntityIdentifierMapping.Nature
-
getPartMappingType
public EmbeddableMappingType getPartMappingType()
Description copied from interface:ModelPart
The type for this part.- Specified by:
getPartMappingType
in interfaceCompositeIdentifierMapping
- Specified by:
getPartMappingType
in interfaceModelPart
- Overrides:
getPartMappingType
in classAbstractAttributeMapping
-
getIdClassEmbeddable
public IdClassEmbeddable getIdClassEmbeddable()
Description copied from interface:NonAggregatedIdentifierMapping
The id-class representation of this id mapping- Specified by:
getIdClassEmbeddable
in interfaceNonAggregatedIdentifierMapping
-
getVirtualIdEmbeddable
public VirtualIdEmbeddable getVirtualIdEmbeddable()
Description copied from interface:NonAggregatedIdentifierMapping
The virtual-id representation of this id mapping- Specified by:
getVirtualIdEmbeddable
in interfaceNonAggregatedIdentifierMapping
-
getIdentifierValueMapper
public NonAggregatedIdentifierMapping.IdentifierValueMapper getIdentifierValueMapper()
Description copied from interface:NonAggregatedIdentifierMapping
The id-class, if there is one, otherwise the virtual-id.- Specified by:
getIdentifierValueMapper
in interfaceNonAggregatedIdentifierMapping
-
hasContainingClass
public boolean hasContainingClass()
Description copied from interface:CompositeIdentifierMapping
Does the identifier have a corresponding EmbeddableId or IdClass?- Specified by:
hasContainingClass
in interfaceCompositeIdentifierMapping
- Returns:
- false if there is not an IdCass or an EmbeddableId
-
getMappedIdEmbeddableTypeDescriptor
public EmbeddableMappingType getMappedIdEmbeddableTypeDescriptor()
Description copied from interface:CompositeIdentifierMapping
Returns the embeddable type descriptor of the id-class, if there is one, otherwise the one of the virtual embeddable mapping type.- Specified by:
getMappedIdEmbeddableTypeDescriptor
in interfaceCompositeIdentifierMapping
-
areEqual
public boolean areEqual(@Nullable Object one, @Nullable Object other, SharedSessionContractImplementor session)
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Breaks down a value ofJ
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 theBindable
for thePerson
entity to disassemble. Given aPerson
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.
- Specified by:
disassemble
in interfaceBindable
- Specified by:
disassemble
in interfaceEmbeddableValuedModelPart
- See Also:
EntityEntry
-
addToCacheKey
public void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.- Specified by:
addToCacheKey
in interfaceBindable
- Specified by:
addToCacheKey
in interfaceEmbeddableValuedModelPart
- Specified by:
addToCacheKey
in interfaceJavaTypedExpressible
- Parameters:
cacheKey
- the MutableCacheKey used to add the disassembled value and the hashCodevalue
- the value to disassemblesession
- the SharedSessionContractImplementor
-
forEachJdbcValue
public <X,Y> int forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Visit each constituent JDBC value extracted from the entity instance itself. Short-hand form of callingBindable.disassemble(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor)
and piping its result toBindable.forEachDisassembledJdbcValue(Object, int, JdbcValuesConsumer, SharedSessionContractImplementor)
- Specified by:
forEachJdbcValue
in interfaceBindable
- Specified by:
forEachJdbcValue
in interfaceEmbeddableValuedModelPart
-
toSqlExpression
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
- Specified by:
toSqlExpression
in interfaceEmbeddableValuedModelPart
- Overrides:
toSqlExpression
in classEmbeddedAttributeMapping
-
getIdentifier
public Object getIdentifier(Object entity)
Description copied from interface:EntityIdentifierMapping
Extract the identifier from an instance of the entity- Specified by:
getIdentifier
in interfaceEntityIdentifierMapping
-
getIdentifier
public Object getIdentifier(Object entity, MergeContext mergeContext)
Description copied from interface:EntityIdentifierMapping
Extract the identifier from an instance of the entity It's supposed to be use during the merging process- Specified by:
getIdentifier
in interfaceEntityIdentifierMapping
-
setIdentifier
public void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
Description copied from interface:EntityIdentifierMapping
Inject an identifier value into an instance of the entity- Specified by:
setIdentifier
in interfaceEntityIdentifierMapping
-
breakDownJdbcValues
public <X,Y> int breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Description copied from interface:ModelPart
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 valuesX
andY
to the consumer. Returns the amount of jdbc types that have been visited.- Specified by:
breakDownJdbcValues
in interfaceEmbeddableValuedModelPart
- Specified by:
breakDownJdbcValues
in interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceModelPart
- Overrides:
applySqlSelections
in classEmbeddedAttributeMapping
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceModelPart
- Overrides:
applySqlSelections
in classEmbeddedAttributeMapping
-
getSqlAliasStem
public String getSqlAliasStem()
Description copied from interface:TableGroupProducer
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedNote that this is a metadata-ive value. It is only ever used internal to the producer producing its TableGroup.
- Specified by:
getSqlAliasStem
in interfaceTableGroupProducer
- Overrides:
getSqlAliasStem
in classEmbeddedAttributeMapping
- See Also:
SqlAliasBaseManager.createSqlAliasBase(java.lang.String)
-
getFetchableName
public String getFetchableName()
Description copied from interface:Fetchable
The name of the fetchable. This is the part's "local name".- Specified by:
getFetchableName
in interfaceFetchable
- Overrides:
getFetchableName
in classAbstractStateArrayContributorMapping
- See Also:
ModelPart.getNavigableRole()
,NavigableRole.getLocalName()
-
getNumberOfFetchables
public int getNumberOfFetchables()
Description copied from interface:FetchableContainer
The number of fetchables in the container- Specified by:
getNumberOfFetchables
in interfaceEmbeddableValuedModelPart
- Specified by:
getNumberOfFetchables
in interfaceFetchableContainer
-
getFetchable
public Fetchable getFetchable(int position)
- Specified by:
getFetchable
in interfaceEmbeddableValuedModelPart
- Specified by:
getFetchable
in interfaceFetchableContainer
-
-