Class BasicEntityIdentifierMappingImpl
java.lang.Object
org.hibernate.metamodel.mapping.internal.BasicEntityIdentifierMappingImpl
- All Implemented Interfaces:
AttributeMapping
,AttributeMetadata
,BasicEntityIdentifierMapping
,BasicValuedMapping
,BasicValuedModelPart
,Bindable
,EntityIdentifierMapping
,SingleAttributeIdentifierMapping
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,OwnedValuedModelPart
,PropertyBasedMapping
,SelectableMapping
,SelectableMappings
,SqlExpressible
,SqlTypedMapping
,ValuedModelPart
,ValueMapping
,DatabaseSnapshotContributor
,Fetchable
,FetchOptions
,FetchStyleAccess
,FetchTimingAccess
,JavaTypedExpressible
,MutabilityPlanExposer
public class BasicEntityIdentifierMappingImpl
extends Object
implements BasicEntityIdentifierMapping, FetchOptions
Mapping of a simple identifier
- See Also:
-
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 -
Field Summary
Fields inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
ID_ROLE_NAME, LEGACY_ID_NAME
-
Constructor Summary
ConstructorDescriptionBasicEntityIdentifierMappingImpl
(EntityPersister entityPersister, Supplier<?> instanceCreator, String attributeName, String rootTable, String pkColumnName, String columnDefinition, Long length, Integer precision, Integer scale, boolean insertable, boolean updateable, BasicType<?> idType, MappingModelCreationProcess creationProcess) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.<X,
Y> int breakDownJdbcValues
(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.<T> DomainResult<T>
createDomainResult
(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState) Create a DomainResult for a specific reference to this ModelPart.disassemble
(Object value, SharedSessionContractImplementor session) Breaks down a value ofJ
into its simple pieces.<X,
Y> int forEachDisassembledJdbcValue
(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session) LikeBindable.forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)
, but additionally receives an offset by which the selectionIndex is incremented when callingBindable.JdbcValuesBiConsumer.consume(int, Object, Object, Object, JdbcMapping)
.int
forEachJdbcType
(int offset, IndexedConsumer<JdbcMapping> action) Visit each JdbcMapping starting from the given offsetint
forEachSelectable
(int offset, SelectableConsumer consumer) Visits each selectable mapping with the selectable index offset by the given value.generateFetch
(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) Generates a Fetch of this fetchableThe name of the attribute defining the id, if oneThe table which contains the columns mapped by this valueThe selection's read expression accounting for formula treatment as well asColumnTransformer.read()
The selection's write expression accountingColumnTransformer.write()
The name of the fetchable.getIdentifier
(Object entity) Extract the identifier from an instance of the entityJavaType<?>
The Java type for this part.Anything that is expressible at the SQL AST level would be of basic type.The configured fetch timing and styleDescriptor for the type of this mappingThe type for this part.Access to the identifier attribute's PropertyAccessgetScale()
The selection's expression.getStyle()
The strategy for distinguishing between detached and transient state based on the identifier mappingboolean
Instantiate an instance of the identifier.boolean
Is the mapping a formula instead of a physical column?boolean
boolean
Is the mapping considered nullable?boolean
boolean
void
setIdentifier
(Object entity, Object id, SharedSessionContractImplementor session) Inject an identifier value into an instance of the entitytoString()
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, asEmbeddedAttributeMapping, asPluralAttributeMapping, compare, getExposedMutabilityPlan, getValue, isEmbeddedAttributeMapping, isPluralAttributeMapping, setValue
Methods inherited from interface org.hibernate.metamodel.mapping.AttributeMetadata
getCascadeStyle
Methods inherited from interface org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping
getFetchableKey
Methods inherited from interface org.hibernate.metamodel.mapping.BasicValuedModelPart
asBasicValuedModelPart, forEachSelectable, getJdbcMapping, getJdbcTypeCount, getSelectable, getSingleJdbcMapping
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
Methods inherited from interface org.hibernate.sql.results.graph.DatabaseSnapshotContributor
createSnapshotDomainResult
Methods inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
getIdentifierIfNotUnsaved, isEntityIdentifierMapping
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
incrementFetchDepth, resolveCircularFetch
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asEntityMappingType, breakDownJdbcValues, decompose, decompose, isVirtual
Methods inherited from interface org.hibernate.metamodel.mapping.SelectableMapping
getSelectableName, getSelectablePath, getWriteExpression
Methods inherited from interface org.hibernate.metamodel.mapping.internal.SingleAttributeIdentifierMapping
getAttributeMetadata, getDeclaringType, getGenerator, getMutabilityPlan, getPartName, getStateArrayPosition, isIncludedInDirtyChecking, isIncludedInOptimisticLocking, isSelectable, isUpdatable
Methods inherited from interface org.hibernate.metamodel.mapping.SqlTypedMapping
isLob, toSize
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachNonFormula, forEachUpdatable, getJdbcTypeCount, getSingleJdbcMapping
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
Constructor Details
-
BasicEntityIdentifierMappingImpl
public BasicEntityIdentifierMappingImpl(EntityPersister entityPersister, Supplier<?> instanceCreator, String attributeName, String rootTable, String pkColumnName, String columnDefinition, Long length, Integer precision, Integer scale, boolean insertable, boolean updateable, BasicType<?> idType, MappingModelCreationProcess creationProcess)
-
-
Method Details
-
toString
-
getPropertyAccess
Description copied from interface:SingleAttributeIdentifierMapping
Access to the identifier attribute's PropertyAccess- Specified by:
getPropertyAccess
in interfaceAttributeMapping
- Specified by:
getPropertyAccess
in interfaceAttributeMetadata
- Specified by:
getPropertyAccess
in interfacePropertyBasedMapping
- Specified by:
getPropertyAccess
in interfaceSingleAttributeIdentifierMapping
-
getAttributeName
Description copied from interface:EntityIdentifierMapping
The name of the attribute defining the id, if one- Specified by:
getAttributeName
in interfaceAttributeMapping
- Specified by:
getAttributeName
in interfaceEntityIdentifierMapping
- Specified by:
getAttributeName
in interfaceSingleAttributeIdentifierMapping
-
getNature
- Specified by:
getNature
in interfaceEntityIdentifierMapping
- See Also:
-
getUnsavedStrategy
Description copied from interface:EntityIdentifierMapping
The strategy for distinguishing between detached and transient state based on the identifier mapping- Specified by:
getUnsavedStrategy
in interfaceEntityIdentifierMapping
- See Also:
-
getIdentifier
Description copied from interface:EntityIdentifierMapping
Extract the identifier from an instance of the entity- Specified by:
getIdentifier
in interfaceEntityIdentifierMapping
-
instantiate
Description copied from interface:EntityIdentifierMapping
Instantiate an instance of the identifier.- Specified by:
instantiate
in interfaceEntityIdentifierMapping
-
getPartMappingType
Description copied from interface:ModelPart
The type for this part.- Specified by:
getPartMappingType
in interfaceBasicValuedModelPart
- Specified by:
getPartMappingType
in interfaceModelPart
-
getMappedType
Description copied from interface:ValueMapping
Descriptor for the type of this mapping- Specified by:
getMappedType
in interfaceValueMapping
-
forEachSelectable
Description copied from interface:ModelPart
Visits each selectable mapping with the selectable index offset by the given value. Returns the amount of jdbc types that have been visited.- Specified by:
forEachSelectable
in interfaceBasicValuedModelPart
- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- Specified by:
forEachSelectable
in interfaceValuedModelPart
- See Also:
-
findContainingEntityMapping
- Specified by:
findContainingEntityMapping
in interfaceAttributeMapping
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
forEachJdbcType
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
getJavaType
Description copied from interface:ModelPart
The Java type for this part. Generally equivalent toMappingType.getMappedJavaType()
relative toModelPart.getPartMappingType()
- Specified by:
getJavaType
in interfaceModelPart
-
getContainingTableExpression
Description copied from interface:ValuedModelPart
The table which contains the columns mapped by this value- Specified by:
getContainingTableExpression
in interfaceSelectableMapping
- Specified by:
getContainingTableExpression
in interfaceValuedModelPart
-
getSelectionExpression
Description copied from interface:SelectableMapping
The selection's expression. This is the column name or formula- Specified by:
getSelectionExpression
in interfaceSelectableMapping
-
isFormula
public boolean isFormula()Description copied from interface:SelectableMapping
Is the mapping a formula instead of a physical column?- Specified by:
isFormula
in interfaceSelectableMapping
-
isNullable
public boolean isNullable()Description copied from interface:SelectableMapping
Is the mapping considered nullable?- Specified by:
isNullable
in interfaceAttributeMetadata
- Specified by:
isNullable
in interfaceBasicEntityIdentifierMapping
- Specified by:
isNullable
in interfaceSelectableMapping
- Specified by:
isNullable
in interfaceSingleAttributeIdentifierMapping
-
isInsertable
public boolean isInsertable()- Specified by:
isInsertable
in interfaceAttributeMetadata
- Specified by:
isInsertable
in interfaceBasicEntityIdentifierMapping
- Specified by:
isInsertable
in interfaceSelectableMapping
- Specified by:
isInsertable
in interfaceSingleAttributeIdentifierMapping
-
isUpdateable
public boolean isUpdateable()- Specified by:
isUpdateable
in interfaceSelectableMapping
-
isPartitioned
public boolean isPartitioned()- Specified by:
isPartitioned
in interfaceSelectableMapping
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()- Specified by:
hasPartitionedSelectionMapping
in interfaceBasicValuedModelPart
- Specified by:
hasPartitionedSelectionMapping
in interfaceModelPart
-
getCustomReadExpression
Description copied from interface:SelectableMapping
The selection's read expression accounting for formula treatment as well asColumnTransformer.read()
- Specified by:
getCustomReadExpression
in interfaceSelectableMapping
-
getCustomWriteExpression
Description copied from interface:SelectableMapping
The selection's write expression accountingColumnTransformer.write()
- Specified by:
getCustomWriteExpression
in interfaceSelectableMapping
-
getColumnDefinition
- Specified by:
getColumnDefinition
in interfaceSqlTypedMapping
-
getLength
- Specified by:
getLength
in interfaceSqlTypedMapping
-
getPrecision
- Specified by:
getPrecision
in interfaceSqlTypedMapping
-
getTemporalPrecision
- Specified by:
getTemporalPrecision
in interfaceSqlTypedMapping
-
getScale
- Specified by:
getScale
in interfaceSqlTypedMapping
-
getJdbcMapping
Description copied from interface:SqlExpressible
Anything that is expressible at the SQL AST level would be of basic type.- Specified by:
getJdbcMapping
in interfaceBasicValuedMapping
- Specified by:
getJdbcMapping
in interfaceSqlExpressible
- Specified by:
getJdbcMapping
in interfaceSqlTypedMapping
-
getFetchableName
Description copied from interface:Fetchable
The name of the fetchable. This is the part's "local name".- Specified by:
getFetchableName
in interfaceFetchable
- See Also:
-
getMappedFetchOptions
Description copied from interface:Fetchable
The configured fetch timing and style- Specified by:
getMappedFetchOptions
in interfaceFetchable
-
getStyle
- Specified by:
getStyle
in interfaceFetchStyleAccess
-
getTiming
- Specified by:
getTiming
in interfaceFetchTimingAccess
-