Class AbstractEmbeddableMapping
java.lang.Object
org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
- All Implemented Interfaces:
Bindable
,EmbeddableMappingType
,EmbeddableMappingType.ConcreteEmbeddableType
,JdbcMappingContainer
,ManagedMappingType
,MappingModelExpressible
,MappingType
,ModelPart
,ModelPartContainer
,SelectableMappings
,FetchableContainer
- Direct Known Subclasses:
EmbeddableMappingTypeImpl
,IdClassEmbeddable
,VirtualIdEmbeddable
public abstract class AbstractEmbeddableMapping
extends Object
implements EmbeddableMappingType, EmbeddableMappingType.ConcreteEmbeddableType
Base support for EmbeddableMappingType implementations
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
protected static interface
protected static class
protected static interface
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.EmbeddableMappingType
EmbeddableMappingType.ConcreteEmbeddableType
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,
Y>, ModelPart.JdbcValueConsumer -
Field Summary
Modifier and TypeFieldDescriptionprotected final MutableAttributeMappingList
protected Getter[]
protected SelectableMappings
protected Setter[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttribute
(AttributeMapping attributeMapping) 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.<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.protected void
boolean
declaresAttribute
(int attributeIndex) boolean
declaresAttribute
(AttributeMapping attributeMapping) Returnstrue
if the provided embeddable class contains the specified attribute mapping,false
otherwise.protected String
disassemble
(Object value, SharedSessionContractImplementor session) Breaks down a value ofJ
into its simple pieces.findAttributeMapping
(String name) Find an attribute by name.findSubPart
(String name, EntityMappingType treatTargetType) protected boolean
finishInitialization
(NavigableRole navigableRole, Component bootDescriptor, CompositeType compositeType, String rootTableExpression, String[] rootTableKeyColumnNames, EmbeddableMappingType declarer, EmbeddableRepresentationStrategy representationStrategy, AbstractEmbeddableMapping.AttributeTypeValidator attributeTypeValidator, AbstractEmbeddableMapping.ConcreteTableResolver concreteTableResolver, Consumer<AttributeMapping> attributeConsumer, AbstractEmbeddableMapping.SuccessfulCompletionCallback completionCallback, MappingModelCreationProcess creationProcess) void
forEachAttributeMapping
(Consumer<? super AttributeMapping> action) Visit attributes defined on this class and any supersvoid
forEachAttributeMapping
(IndexedConsumer<? super AttributeMapping> consumer) Visit attributes defined on this class and any supers<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 offset<X,
Y> int forEachJdbcValue
(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.int
forEachSelectable
(int offset, SelectableConsumer consumer) Visits each selectable mapping with the selectable index offset by the given value.int
forEachSelectable
(SelectableConsumer consumer) A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.void
forEachSubPart
(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget) getAttributeMapping
(int position) Retrieve an attribute by its contributor positionGet access to the attributes defined on this class and any supersprotected Object[]
getAttributeValues
(Object compositeInstance) getFetchable
(int position) getJdbcMapping
(int index) int
The number of JDBC mappingsJavaType<?>
The descriptor descriptor for the mapped Java typeint
Get the number of attributes defined on this class and any supersint
The number of fetchables in the containergetSelectable
(int columnIndex) Get the selectable at the given positionprotected SelectableMappings
int
Extract a specific attribute value from the entity instance, by positionObject[]
Extract the individual attribute values from the entity instanceprotected boolean
protected boolean
inverseInitializeCallback
(TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableMappingType inverseMappingType, MappingModelCreationProcess creationProcess, ManagedMappingType declaringType, MutableAttributeMappingList mappings) protected void
setAttributeValues
(Object component, Object[] values) void
Inject a specific attribute value into the entity instance, by positionvoid
Inject the attribute values into the entity instancevoid
visitFetchables
(Consumer<? super Fetchable> consumer, EntityMappingType treatTargetType) void
visitFetchables
(IndexedConsumer<? super Fetchable> indexedConsumer, EntityMappingType treatTargetType) void
visitSubParts
(Consumer<ModelPart> consumer, EntityMappingType treatTargetType) 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, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableMappingType
anyRequiresAggregateColumnWriter, applySqlSelections, applySqlSelections, compare, createDomainResult, createInverseMappingType, findSubtypeByDiscriminator, findSubtypeBySubclass, forEachInsertable, forEachUpdatable, getAggregateMapping, getConcreteEmbeddableTypes, getDiscriminatorMapping, getEmbeddedValueMapping, getJdbcValueCount, getJdbcValueSelectable, getPartMappingType, getRepresentationStrategy, getSelectableIndex, isCreateEmptyCompositesEnabled, isPolymorphic, requiresAggregateColumnWriter, shouldBindAggregateMapping, shouldMutateAggregateMapping, shouldSelectAggregateMapping
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getSingleJdbcMapping
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
getJavaType, hasPartitionedSelectionMapping, isAffectedByEnabledFilters
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, decompose, findContainingEntityMapping, getNavigableRole, getPartName, isEntityIdentifierMapping, isVirtual
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
-
Field Details
-
attributeMappings
-
selectableMappings
-
getterCache
-
setterCache
-
-
Constructor Details
-
AbstractEmbeddableMapping
-
-
Method Details
-
getInstantiator
- Specified by:
getInstantiator
in interfaceEmbeddableMappingType.ConcreteEmbeddableType
-
getSubclassId
public int getSubclassId()- Specified by:
getSubclassId
in interfaceEmbeddableMappingType.ConcreteEmbeddableType
-
declaresAttribute
Description copied from interface:EmbeddableMappingType.ConcreteEmbeddableType
Returnstrue
if the provided embeddable class contains the specified attribute mapping,false
otherwise.- Specified by:
declaresAttribute
in interfaceEmbeddableMappingType.ConcreteEmbeddableType
- Parameters:
attributeMapping
- the attribute to check
-
declaresAttribute
public boolean declaresAttribute(int attributeIndex) - Specified by:
declaresAttribute
in interfaceEmbeddableMappingType.ConcreteEmbeddableType
-
getValue
Description copied from interface:ManagedMappingType
Extract a specific attribute value from the entity instance, by position- Specified by:
getValue
in interfaceManagedMappingType
-
setValue
Description copied from interface:ManagedMappingType
Inject a specific attribute value into the entity instance, by position- Specified by:
setValue
in interfaceManagedMappingType
-
getDiscriminatorValue
- Specified by:
getDiscriminatorValue
in interfaceEmbeddableMappingType.ConcreteEmbeddableType
-
getMappedJavaType
Description copied from interface:MappingType
The descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaType
in interfaceMappingType
-
getValues
Description copied from interface:ManagedMappingType
Extract the individual attribute values from the entity instance- Specified by:
getValues
in interfaceManagedMappingType
-
getAttributeValues
-
setValues
Description copied from interface:ManagedMappingType
Inject the attribute values into the entity instance- Specified by:
setValues
in interfaceManagedMappingType
-
setAttributeValues
-
inverseInitializeCallback
protected boolean inverseInitializeCallback(TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableMappingType inverseMappingType, MappingModelCreationProcess creationProcess, ManagedMappingType declaringType, MutableAttributeMappingList mappings) -
determineEmbeddablePrefix
-
getNumberOfFetchables
public int getNumberOfFetchables()Description copied from interface:FetchableContainer
The number of fetchables in the container- Specified by:
getNumberOfFetchables
in interfaceFetchableContainer
-
getFetchable
- Specified by:
getFetchable
in interfaceFetchableContainer
-
visitFetchables
public void visitFetchables(Consumer<? super Fetchable> consumer, EntityMappingType treatTargetType) - Specified by:
visitFetchables
in interfaceFetchableContainer
-
visitFetchables
public void visitFetchables(IndexedConsumer<? super Fetchable> indexedConsumer, EntityMappingType treatTargetType) - Specified by:
visitFetchables
in interfaceFetchableContainer
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()Description copied from interface:ManagedMappingType
Get the number of attributes defined on this class and any supers- Specified by:
getNumberOfAttributeMappings
in interfaceManagedMappingType
-
getAttributeMapping
Description copied from interface:ManagedMappingType
Retrieve an attribute by its contributor position- Specified by:
getAttributeMapping
in interfaceManagedMappingType
-
findAttributeMapping
Description copied from interface:ManagedMappingType
Find an attribute by name.- Specified by:
findAttributeMapping
in interfaceManagedMappingType
- Returns:
- The named attribute, or
null
if no match was found
-
getAttributeMappings
Description copied from interface:ManagedMappingType
Get access to the attributes defined on this class and any supers- Specified by:
getAttributeMappings
in interfaceManagedMappingType
-
getSelectable
Description copied from interface:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceSelectableMappings
-
forEachSelectable
Description copied from interface:ModelPart
A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.- Specified by:
forEachSelectable
in interfaceEmbeddableMappingType
- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
-
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 interfaceEmbeddableMappingType
- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- See Also:
-
getJdbcTypeCount
public int getJdbcTypeCount()Description copied from interface:Bindable
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceEmbeddableMappingType
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
- Specified by:
getJdbcTypeCount
in interfaceSelectableMappings
-
forEachJdbcType
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceEmbeddableMappingType
- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
getJdbcMapping
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
forEachAttributeMapping
Description copied from interface:ManagedMappingType
Visit attributes defined on this class and any supers- Specified by:
forEachAttributeMapping
in interfaceManagedMappingType
-
forEachAttributeMapping
Description copied from interface:ManagedMappingType
Visit attributes defined on this class and any supers- Specified by:
forEachAttributeMapping
in interfaceManagedMappingType
-
findSubPart
- Specified by:
findSubPart
in interfaceModelPartContainer
-
forEachSubPart
- Specified by:
forEachSubPart
in interfaceModelPartContainer
-
visitSubParts
- Specified by:
visitSubParts
in interfaceModelPartContainer
-
addAttribute
-
getSelectableMappings
-
initColumnMappings
protected boolean initColumnMappings() -
buildGetterSetterCache
protected void buildGetterSetterCache()
-