Class EmbeddedIdentifierMappingImpl
- java.lang.Object
-
- org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping
-
- org.hibernate.metamodel.mapping.internal.EmbeddedIdentifierMappingImpl
-
- All Implemented Interfaces:
AggregatedIdentifierMapping
,Bindable
,CompositeIdentifierMapping
,EmbeddableValuedModelPart
,EntityIdentifierMapping
,SingleAttributeIdentifierMapping
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,ModelPartContainer
,PropertyBasedMapping
,SelectableMappings
,ValuedModelPart
,ValueMapping
,TableGroupJoinProducer
,TableGroupProducer
,EmbeddableValuedFetchable
,Fetchable
,FetchableContainer
,FetchOptions
,FetchStyleAccess
,FetchTimingAccess
,JavaTypedExpressible
public class EmbeddedIdentifierMappingImpl extends AbstractCompositeIdentifierMapping implements AggregatedIdentifierMapping
Support forEmbeddedId
-
-
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.EntityIdentifierMapping
EntityIdentifierMapping.Nature
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.IndexedJdbcValueConsumer, ModelPart.JdbcValueConsumer
-
-
Field Summary
-
Fields inherited from class org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping
sessionFactory
-
Fields inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
ROLE_LOCAL_NAME
-
-
Constructor Summary
Constructors Constructor Description EmbeddedIdentifierMappingImpl(EntityMappingType entityMapping, String name, EmbeddableMappingType embeddableDescriptor, PropertyAccess propertyAccess, String tableExpression, MappingModelCreationProcess creationProcess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
Object
disassemble(Object value, SharedSessionContractImplementor session)
int
forEachDisassembledJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
String
getAttributeName()
The name of the attribute defining the id, if oneFetchable
getFetchable(int position)
String
getFetchableName()
The name of the fetchable.Object
getIdentifier(Object entity)
Extract the identifier from an instance of the entityEmbeddableMappingType
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 namePropertyAccess
getPropertyAccess()
Access to the identifier attribute's PropertyAccessString
getSqlAliasStem()
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedvoid
setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
Inject an identifier value into an instance of the entity-
Methods inherited from class org.hibernate.metamodel.internal.AbstractCompositeIdentifierMapping
createDomainResult, createRootTableGroupJoin, createTableGroupJoin, findContainingEntityMapping, findSubPart, forEachJdbcValue, generateFetch, getContainingTableExpression, getEmbeddableTypeDescriptor, getEntityMapping, getJavaType, getMappedFetchOptions, getMappedType, getNavigableRole, getStyle, getTiming, hasContainingClass, hasPartitionedSelectionMapping, instantiate, toSqlExpression, visitSubParts
-
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.Bindable
forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.CompositeIdentifierMapping
getFetchableKey, getUnsavedStrategy
-
Methods inherited from interface org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable
getDefaultSqlAstJoinType, isSimpleJoinPredicate
-
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableValuedModelPart
forEachJdbcType, forEachSelectable, forEachSubPart, getJdbcMappings, getJdbcTypeCount, getParentInjectionAttributePropertyAccess, getSelectable
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityIdentifierMapping
getIdentifierIfNotUnsaved, instantiate
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, incrementFetchDepth, resolveCircularFetch
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, createDomainResult, decompose, findContainingEntityMapping, getJavaType, getNavigableRole, hasPartitionedSelectionMapping, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
createRootTableGroupJoin, createTableGroupJoin
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachSelectable, forEachUpdatable, getContainingTableExpression
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Constructor Detail
-
EmbeddedIdentifierMappingImpl
public EmbeddedIdentifierMappingImpl(EntityMappingType entityMapping, String name, EmbeddableMappingType embeddableDescriptor, PropertyAccess propertyAccess, String tableExpression, MappingModelCreationProcess creationProcess)
-
-
Method Detail
-
getPartName
public String getPartName()
Description copied from interface:ModelPart
The local part name, which is generally the unqualified role name- 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
-
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
-
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
-
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
-
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
-
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
-
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
- 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
- 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 interfaceFetchableContainer
-
getFetchable
public Fetchable getFetchable(int position)
- Specified by:
getFetchable
in interfaceFetchableContainer
-
getPropertyAccess
public PropertyAccess getPropertyAccess()
Description copied from interface:SingleAttributeIdentifierMapping
Access to the identifier attribute's PropertyAccess- Specified by:
getPropertyAccess
in interfacePropertyBasedMapping
- Specified by:
getPropertyAccess
in interfaceSingleAttributeIdentifierMapping
-
getAttributeName
public String getAttributeName()
Description copied from interface:EntityIdentifierMapping
The name of the attribute defining the id, if one- Specified by:
getAttributeName
in interfaceEntityIdentifierMapping
- Specified by:
getAttributeName
in interfaceSingleAttributeIdentifierMapping
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValues
in interfaceModelPart
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValue
in interfaceBindable
- Specified by:
forEachDisassembledJdbcValue
in interfaceEmbeddableValuedModelPart
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemble
in interfaceBindable
- Specified by:
disassemble
in interfaceEmbeddableValuedModelPart
- See Also:
As an example, consider the following domain model: ````
-
-