Package org.hibernate.metamodel.mapping
Interface EntityIdentifierMapping
-
- All Superinterfaces:
Bindable
,JavaTypedExpressible
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,ValueMapping
- All Known Subinterfaces:
BasicEntityIdentifierMapping
,CompositeIdentifierMapping
,NonAggregatedIdentifierMapping
,SingleAttributeIdentifierMapping
- All Known Implementing Classes:
AbstractCompositeIdentifierMapping
,AnonymousTupleBasicEntityIdentifierMapping
,AnonymousTupleEmbeddedEntityIdentifierMapping
,AnonymousTupleNonAggregatedEntityIdentifierMapping
,BasicEntityIdentifierMappingImpl
,EmbeddedIdentifierMappingImpl
,InverseNonAggregatedIdentifierMapping
,NonAggregatedIdentifierMappingImpl
public interface EntityIdentifierMapping extends ValueMapping, ModelPart
Describes the mapping of an entity's identifier.- See Also:
Id
,EmbeddedId
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueConsumer
-
-
Field Summary
Fields Modifier and Type Field Description static String
ROLE_LOCAL_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Object
getIdentifier(Object entity)
Object
getIdentifier(Object entity, SharedSessionContractImplementor session)
Deprecated.default Object
getIdentifierIfNotUnsaved(Object entity, SharedSessionContractImplementor session)
Return the identifier of the persistent or transient object, or throw an exception if the instance is "unsaved"default String
getPartName()
IdentifierValue
getUnsavedStrategy()
The strategy for distinguishing between detached and transient state based on the identifier mappingObject
instantiate()
void
setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
disassemble, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, getJdbcMappings, getJdbcTypeCount
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
forEachJdbcType
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
applySqlSelections, applySqlSelections, areEqual, asAttributeMapping, breakDownJdbcValues, createDomainResult, findContainingEntityMapping, forEachSelectable, forEachSelectable, getJavaType, getNavigableRole, getPartMappingType
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, getMappedType, treatAs
-
-
-
-
Field Detail
-
ROLE_LOCAL_NAME
static final String ROLE_LOCAL_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPartName
default String getPartName()
- Specified by:
getPartName
in interfaceModelPart
-
getUnsavedStrategy
IdentifierValue getUnsavedStrategy()
The strategy for distinguishing between detached and transient state based on the identifier mapping
-
getIdentifier
@Deprecated Object getIdentifier(Object entity, SharedSessionContractImplementor session)
Deprecated.- Returns:
- the entity identifier value
-
getIdentifierIfNotUnsaved
default Object getIdentifierIfNotUnsaved(Object entity, SharedSessionContractImplementor session)
Return the identifier of the persistent or transient object, or throw an exception if the instance is "unsaved" Used by OneToOneType and ManyToOneType to determine what id value should be used for an object that may or may not be associated with the session. This does a "best guess" using any/all info available to use (not just the EntityEntry).- Parameters:
entity
- The entity instancesession
- The session- Returns:
- The identifier
- Throws:
TransientObjectException
- if the entity is transient (does not yet have an identifier)- Since:
- 6.1.1
- See Also:
ForeignKeys.getEntityIdentifierIfNotUnsaved(String, Object, SharedSessionContractImplementor)
-
setIdentifier
void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
-
instantiate
Object instantiate()
-
-