Class BasicEntityIdentifierMappingImpl
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.BasicEntityIdentifierMappingImpl
-
- All Implemented Interfaces:
BasicEntityIdentifierMapping,BasicValuedMapping,BasicValuedModelPart,Bindable,EntityIdentifierMapping,SingleAttributeIdentifierMapping,JdbcMappingContainer,MappingModelExpressible,ModelPart,PropertyBasedMapping,SelectableMapping,SqlExpressible,SqlTypedMapping,ValueMapping,Fetchable,FetchOptions,FetchStyleAccess,FetchTimingAccess,JavaTypedExpressible
public class BasicEntityIdentifierMappingImpl extends Object implements BasicEntityIdentifierMapping, FetchOptions
-
-
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 inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
ROLE_LOCAL_NAME
-
-
Constructor Summary
Constructors Constructor Description BasicEntityIdentifierMappingImpl(EntityPersister entityPersister, Supplier<?> instanceCreator, String attributeName, String rootTable, String pkColumnName, String columnDefinition, Long length, Integer precision, Integer scale, BasicType<?> idType, MappingModelCreationProcess creationProcess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.voidapplySqlSelections(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.voidbreakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)<T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for a specific reference to this ModelPart.Objectdisassemble(Object value, SharedSessionContractImplementor session)EntityMappingTypefindContainingEntityMapping()intforEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Visit each JdbcMapping starting from the given offsetintforEachSelectable(int offset, SelectableConsumer consumer)FetchgenerateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)Generates a Fetch of this fetchableStringgetAttributeName()StringgetColumnDefinition()StringgetContainingTableExpression()StringgetCustomReadExpression()StringgetCustomWriteExpression()StringgetFetchableName()The name of the fetchableObjectgetIdentifier(Object entity)ObjectgetIdentifier(Object entity, SharedSessionContractImplementor session)JavaType<?>getJavaType()JdbcMappinggetJdbcMapping()Anything that is expressible at the SQL AST level would be of basic type.LonggetLength()FetchOptionsgetMappedFetchOptions()The configured fetch timing and styleMappingTypegetMappedType()Descriptor for the type of this mappingNavigableRolegetNavigableRole()MappingTypegetPartMappingType()IntegergetPrecision()PropertyAccessgetPropertyAccess()Access to the identifier attribute's PropertyAccessIntegergetScale()StringgetSelectionExpression()FetchStylegetStyle()FetchTiminggetTiming()IdentifierValuegetUnsavedStrategy()The strategy for distinguishing between detached and transient state based on the identifier mappingObjectinstantiate()booleanisFormula()voidsetIdentifier(Object entity, Object id, SharedSessionContractImplementor session)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.BasicValuedMapping
getJdbcMappings, getJdbcTypeCount
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
getIdentifierIfNotUnsaved, getPartName
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, incrementFetchDepth, resolveCircularFetch
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, forEachSelectable
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Constructor Detail
-
BasicEntityIdentifierMappingImpl
public BasicEntityIdentifierMappingImpl(EntityPersister entityPersister, Supplier<?> instanceCreator, String attributeName, String rootTable, String pkColumnName, String columnDefinition, Long length, Integer precision, Integer scale, BasicType<?> idType, MappingModelCreationProcess creationProcess)
-
-
Method Detail
-
getPropertyAccess
public PropertyAccess getPropertyAccess()
Description copied from interface:SingleAttributeIdentifierMappingAccess to the identifier attribute's PropertyAccess- Specified by:
getPropertyAccessin interfacePropertyBasedMapping- Specified by:
getPropertyAccessin interfaceSingleAttributeIdentifierMapping
-
getAttributeName
public String getAttributeName()
- Specified by:
getAttributeNamein interfaceSingleAttributeIdentifierMapping
-
getUnsavedStrategy
public IdentifierValue getUnsavedStrategy()
Description copied from interface:EntityIdentifierMappingThe strategy for distinguishing between detached and transient state based on the identifier mapping- Specified by:
getUnsavedStrategyin interfaceEntityIdentifierMapping
-
getIdentifier
public Object getIdentifier(Object entity, SharedSessionContractImplementor session)
- Specified by:
getIdentifierin interfaceEntityIdentifierMapping- Returns:
- the entity identifier value
-
getIdentifier
public Object getIdentifier(Object entity)
- Specified by:
getIdentifierin interfaceEntityIdentifierMapping
-
setIdentifier
public void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
- Specified by:
setIdentifierin interfaceEntityIdentifierMapping
-
instantiate
public Object instantiate()
- Specified by:
instantiatein interfaceEntityIdentifierMapping
-
getPartMappingType
public MappingType getPartMappingType()
- Specified by:
getPartMappingTypein interfaceBasicValuedModelPart- Specified by:
getPartMappingTypein interfaceModelPart
-
getMappedType
public MappingType getMappedType()
Description copied from interface:ValueMappingDescriptor for the type of this mapping- Specified by:
getMappedTypein interfaceValueMapping
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer consumer)- Specified by:
forEachSelectablein interfaceModelPart
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValuesin interfaceModelPart
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
getJavaType
public JavaType<?> getJavaType()
- Specified by:
getJavaTypein interfaceModelPart
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRolein interfaceModelPart- See Also:
ModelPart.getPartName()
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPartCreate a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResultin interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
getContainingTableExpression
public String getContainingTableExpression()
- Specified by:
getContainingTableExpressionin interfaceSelectableMapping
-
getSelectionExpression
public String getSelectionExpression()
- Specified by:
getSelectionExpressionin interfaceSelectableMapping
-
isFormula
public boolean isFormula()
- Specified by:
isFormulain interfaceSelectableMapping
-
getCustomReadExpression
public String getCustomReadExpression()
- Specified by:
getCustomReadExpressionin interfaceSelectableMapping
-
getCustomWriteExpression
public String getCustomWriteExpression()
- Specified by:
getCustomWriteExpressionin interfaceSelectableMapping
-
getColumnDefinition
public String getColumnDefinition()
- Specified by:
getColumnDefinitionin interfaceSqlTypedMapping
-
getLength
public Long getLength()
- Specified by:
getLengthin interfaceSqlTypedMapping
-
getPrecision
public Integer getPrecision()
- Specified by:
getPrecisionin interfaceSqlTypedMapping
-
getScale
public Integer getScale()
- Specified by:
getScalein interfaceSqlTypedMapping
-
getJdbcMapping
public JdbcMapping getJdbcMapping()
Description copied from interface:SqlExpressibleAnything that is expressible at the SQL AST level would be of basic type.- Specified by:
getJdbcMappingin interfaceBasicValuedMapping- Specified by:
getJdbcMappingin interfaceSqlExpressible- Specified by:
getJdbcMappingin interfaceSqlTypedMapping
-
getFetchableName
public String getFetchableName()
Description copied from interface:FetchableThe name of the fetchable- Specified by:
getFetchableNamein interfaceFetchable
-
getMappedFetchOptions
public FetchOptions getMappedFetchOptions()
Description copied from interface:FetchableThe configured fetch timing and style- Specified by:
getMappedFetchOptionsin interfaceFetchable
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemblein interfaceBindable- See Also:
As an example, consider the following domain model: ````
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValuein interfaceBindable
-
generateFetch
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:FetchableGenerates a Fetch of this fetchable- Specified by:
generateFetchin interfaceFetchable- Parameters:
fetchParent- The parent of the Fetch we are generatingfetchablePath- The overall path within the graphfetchTiming- The requested fetch timing
-
getStyle
public FetchStyle getStyle()
- Specified by:
getStylein interfaceFetchStyleAccess
-
getTiming
public FetchTiming getTiming()
- Specified by:
getTimingin interfaceFetchTimingAccess
-
-