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
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceprotected static interfaceprotected static classprotected static interfaceNested 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.ConcreteEmbeddableTypeNested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MutableAttributeMappingListprotected Getter[]protected SelectableMappingsprotected Setter[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttribute(AttributeMapping attributeMapping) voidaddToCacheKey(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 voidbooleandeclaresAttribute(int attributeIndex) booleandeclaresAttribute(AttributeMapping attributeMapping) Returnstrueif the provided embeddable class contains the specified attribute mapping,falseotherwise.protected Stringdisassemble(Object value, SharedSessionContractImplementor session) Breaks down a value ofJinto its simple pieces.findAttributeMapping(String name) Find an attribute by name.findSubPart(String name, EntityMappingType treatTargetType) protected booleanfinishInitialization(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) voidforEachAttributeMapping(Consumer<? super AttributeMapping> action) Visit attributes defined on this class and any supersvoidforEachAttributeMapping(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).intforEachJdbcType(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.intforEachSelectable(int offset, SelectableConsumer consumer) Visits each selectable mapping with the selectable index offset by the given value.intforEachSelectable(SelectableConsumer consumer) A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer), that passes 0 as offset.voidforEachSubPart(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) Returns the concrete embeddable subtypes or an empty collection ifEmbeddableMappingType.isPolymorphic()isfalse.getFetchable(int position) getJdbcMapping(int index) intThe number of JDBC mappingsJavaType<?> The descriptor descriptor for the mapped Java typeintGet the number of attributes defined on this class and any supersintThe number of fetchables in the containergetSelectable(int columnIndex) Get the selectable at the given positionprotected SelectableMappingsintExtract a specific attribute value from the entity instance, by positionObject[]Extract the individual attribute values from the entity instanceprotected booleanprotected booleaninverseInitializeCallback(TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableMappingType inverseMappingType, MappingModelCreationProcess creationProcess, ManagedMappingType declaringType, MutableAttributeMappingList mappings) protected voidsetAttributeValues(Object component, Object[] values) voidInject a specific attribute value into the entity instance, by positionvoidInject the attribute values into the entity instancevoidvisitFetchables(Consumer<? super Fetchable> consumer, EntityMappingType treatTargetType) voidvisitFetchables(IndexedConsumer<? super Fetchable> indexedConsumer, EntityMappingType treatTargetType) voidvisitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValueMethods inherited from interface org.hibernate.metamodel.mapping.EmbeddableMappingType
anyRequiresAggregateColumnWriter, applySqlSelections, applySqlSelections, compare, createDomainResult, createInverseMappingType, findSubtypeByDiscriminator, findSubtypeBySubclass, forEachInsertable, forEachUpdatable, getAggregateMapping, getDiscriminatorMapping, getEmbeddedValueMapping, getJdbcValueCount, getJdbcValueSelectable, getPartMappingType, getRepresentationStrategy, getSelectableIndex, isPolymorphic, requiresAggregateColumnWriter, shouldBindAggregateMapping, shouldMutateAggregateMapping, shouldSelectAggregateMappingMethods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchablesMethods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getSingleJdbcMappingMethods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
getJavaType, hasPartitionedSelectionMapping, isAffectedByEnabledFiltersMethods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, decompose, findContainingEntityMapping, getNavigableRole, getPartName, isEntityIdentifierMapping, isVirtualMethods 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:
getInstantiatorin interfaceEmbeddableMappingType.ConcreteEmbeddableType
-
getSubclassId
public int getSubclassId()- Specified by:
getSubclassIdin interfaceEmbeddableMappingType.ConcreteEmbeddableType
-
getConcreteEmbeddableTypes
Description copied from interface:EmbeddableMappingTypeReturns the concrete embeddable subtypes or an empty collection ifEmbeddableMappingType.isPolymorphic()isfalse.- Specified by:
getConcreteEmbeddableTypesin interfaceEmbeddableMappingType
-
declaresAttribute
Description copied from interface:EmbeddableMappingType.ConcreteEmbeddableTypeReturnstrueif the provided embeddable class contains the specified attribute mapping,falseotherwise.- Specified by:
declaresAttributein interfaceEmbeddableMappingType.ConcreteEmbeddableType- Parameters:
attributeMapping- the attribute to check
-
declaresAttribute
public boolean declaresAttribute(int attributeIndex) - Specified by:
declaresAttributein interfaceEmbeddableMappingType.ConcreteEmbeddableType
-
getValue
Description copied from interface:ManagedMappingTypeExtract a specific attribute value from the entity instance, by position- Specified by:
getValuein interfaceManagedMappingType
-
setValue
Description copied from interface:ManagedMappingTypeInject a specific attribute value into the entity instance, by position- Specified by:
setValuein interfaceManagedMappingType
-
getDiscriminatorValue
- Specified by:
getDiscriminatorValuein interfaceEmbeddableMappingType.ConcreteEmbeddableType
-
getMappedJavaType
Description copied from interface:MappingTypeThe descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaTypein interfaceMappingType
-
getValues
Description copied from interface:ManagedMappingTypeExtract the individual attribute values from the entity instance- Specified by:
getValuesin interfaceManagedMappingType
-
getAttributeValues
-
setValues
Description copied from interface:ManagedMappingTypeInject the attribute values into the entity instance- Specified by:
setValuesin 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:FetchableContainerThe number of fetchables in the container- Specified by:
getNumberOfFetchablesin interfaceFetchableContainer
-
getFetchable
- Specified by:
getFetchablein interfaceFetchableContainer
-
visitFetchables
public void visitFetchables(Consumer<? super Fetchable> consumer, EntityMappingType treatTargetType) - Specified by:
visitFetchablesin interfaceFetchableContainer
-
visitFetchables
public void visitFetchables(IndexedConsumer<? super Fetchable> indexedConsumer, EntityMappingType treatTargetType) - Specified by:
visitFetchablesin interfaceFetchableContainer
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()Description copied from interface:ManagedMappingTypeGet the number of attributes defined on this class and any supers- Specified by:
getNumberOfAttributeMappingsin interfaceManagedMappingType
-
getAttributeMapping
Description copied from interface:ManagedMappingTypeRetrieve an attribute by its contributor position- Specified by:
getAttributeMappingin interfaceManagedMappingType
-
findAttributeMapping
Description copied from interface:ManagedMappingTypeFind an attribute by name.- Specified by:
findAttributeMappingin interfaceManagedMappingType- Returns:
- The named attribute, or
nullif no match was found
-
getAttributeMappings
Description copied from interface:ManagedMappingTypeGet access to the attributes defined on this class and any supers- Specified by:
getAttributeMappingsin interfaceManagedMappingType
-
getSelectable
Description copied from interface:SelectableMappingsGet the selectable at the given position- Specified by:
getSelectablein interfaceSelectableMappings
-
forEachSelectable
Description copied from interface:ModelPartA short hand form ofModelPart.forEachSelectable(int, SelectableConsumer), that passes 0 as offset.- Specified by:
forEachSelectablein interfaceEmbeddableMappingType- Specified by:
forEachSelectablein interfaceModelPart- Specified by:
forEachSelectablein interfaceSelectableMappings
-
forEachSelectable
Description copied from interface:ModelPartVisits each selectable mapping with the selectable index offset by the given value. Returns the amount of jdbc types that have been visited.- Specified by:
forEachSelectablein interfaceEmbeddableMappingType- Specified by:
forEachSelectablein interfaceModelPart- Specified by:
forEachSelectablein interfaceSelectableMappings- See Also:
-
getJdbcTypeCount
public int getJdbcTypeCount()Description copied from interface:BindableThe number of JDBC mappings- Specified by:
getJdbcTypeCountin interfaceBindable- Specified by:
getJdbcTypeCountin interfaceEmbeddableMappingType- Specified by:
getJdbcTypeCountin interfaceJdbcMappingContainer- Specified by:
getJdbcTypeCountin interfaceSelectableMappings
-
forEachJdbcType
Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceEmbeddableMappingType- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
getJdbcMapping
- Specified by:
getJdbcMappingin interfaceJdbcMappingContainer
-
forEachAttributeMapping
Description copied from interface:ManagedMappingTypeVisit attributes defined on this class and any supers- Specified by:
forEachAttributeMappingin interfaceManagedMappingType
-
forEachAttributeMapping
Description copied from interface:ManagedMappingTypeVisit attributes defined on this class and any supers- Specified by:
forEachAttributeMappingin interfaceManagedMappingType
-
findSubPart
- Specified by:
findSubPartin interfaceModelPartContainer
-
forEachSubPart
- Specified by:
forEachSubPartin interfaceModelPartContainer
-
visitSubParts
- Specified by:
visitSubPartsin interfaceModelPartContainer
-
addAttribute
-
getSelectableMappings
-
initColumnMappings
protected boolean initColumnMappings() -
buildGetterSetterCache
protected void buildGetterSetterCache()
-