Class EmbeddableMappingTypeImpl
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
-
- org.hibernate.metamodel.mapping.internal.EmbeddableMappingTypeImpl
-
- All Implemented Interfaces:
Bindable,EmbeddableMappingType,EmbeddableMappingType.ConcreteEmbeddableType,JdbcMappingContainer,ManagedMappingType,MappingModelExpressible,MappingType,ModelPart,ModelPartContainer,SelectableMappings,FetchableContainer
public class EmbeddableMappingTypeImpl extends AbstractEmbeddableMapping implements SelectableMappings
Describes a "normal" embeddable.- API Note:
- At the moment, this class is also used to describe some non-"normal" things: mainly composite foreign keys.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
AbstractEmbeddableMapping.AttributeTypeValidator, AbstractEmbeddableMapping.ConcreteTableResolver, AbstractEmbeddableMapping.IllegalAttributeType, AbstractEmbeddableMapping.SuccessfulCompletionCallback
-
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
-
Fields inherited from class org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
attributeMappings, getterCache, selectableMappings, setterCache
-
-
Constructor Summary
Constructors Constructor Description EmbeddableMappingTypeImpl(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableMappingType inverseMappingType, MappingModelCreationProcess creationProcess)
-
Method Summary
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
addAttribute, addToCacheKey, buildGetterSetterCache, declaresAttribute, declaresAttribute, determineEmbeddablePrefix, disassemble, findAttributeMapping, finishInitialization, forEachAttributeMapping, forEachAttributeMapping, forEachDisassembledJdbcValue, forEachJdbcType, forEachSelectable, forEachSelectable, forEachSubPart, getAttributeMapping, getAttributeMappings, getDiscriminatorValue, getFetchable, getInstantiator, getJdbcMapping, getJdbcTypeCount, getNumberOfAttributeMappings, getNumberOfFetchables, getSelectable, getSelectableMappings, getSubclassId, getValue, getValues, initColumnMappings, inverseInitializeCallback, setValue, setValues, visitFetchables, visitFetchables, 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, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableMappingType
anyRequiresAggregateColumnWriter, applySqlSelections, applySqlSelections, compare, getJdbcValueCount, getJdbcValueSelectable, getPartMappingType, getSelectableIndex, isPolymorphic, shouldMutateAggregateMapping
-
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, isEntityIdentifierMapping, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.metamodel.mapping.SelectableMappings
forEachSelectable, forEachSelectable, getJdbcTypeCount, getSelectable
-
-
-
-
Constructor Detail
-
EmbeddableMappingTypeImpl
public EmbeddableMappingTypeImpl(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableMappingType inverseMappingType, MappingModelCreationProcess creationProcess)
-
-
Method Detail
-
from
public static EmbeddableMappingTypeImpl from(Component bootDescriptor, CompositeType compositeType, boolean[] insertability, boolean[] updateability, Function<EmbeddableMappingType,EmbeddableValuedModelPart> embeddedPartBuilder, MappingModelCreationProcess creationProcess)
-
from
public static EmbeddableMappingTypeImpl from(Component bootDescriptor, CompositeType compositeType, String rootTableExpression, String[] rootTableKeyColumnNames, Property componentProperty, DependantValue dependantValue, int dependantColumnIndex, boolean[] insertability, boolean[] updateability, Function<EmbeddableMappingType,EmbeddableValuedModelPart> embeddedPartBuilder, MappingModelCreationProcess creationProcess)
-
createInverseMappingType
public EmbeddableMappingType createInverseMappingType(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess)
- Specified by:
createInverseMappingTypein interfaceEmbeddableMappingType
-
getEmbeddedValueMapping
public EmbeddableValuedModelPart getEmbeddedValueMapping()
- Specified by:
getEmbeddedValueMappingin interfaceEmbeddableMappingType
-
getDiscriminatorMapping
public EmbeddableDiscriminatorMapping getDiscriminatorMapping()
Description copied from interface:EmbeddableMappingTypeReturns the discriminator mapping if this discriminator type is polymorphic,nullotherwise.- Specified by:
getDiscriminatorMappingin interfaceEmbeddableMappingType
-
getMappedJavaType
public JavaType<?> getMappedJavaType()
Description copied from interface:MappingTypeThe descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaTypein interfaceMappingType- Overrides:
getMappedJavaTypein classAbstractEmbeddableMapping
-
getRepresentationStrategy
public EmbeddableRepresentationStrategy getRepresentationStrategy()
- Specified by:
getRepresentationStrategyin interfaceEmbeddableMappingType
-
getPartName
public String getPartName()
Description copied from interface:ModelPartThe local part name, which is generally the unqualified role name- Specified by:
getPartNamein 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 interfaceEmbeddableMappingType- Specified by:
createDomainResultin interfaceModelPart
-
findSubtypeByDiscriminator
public EmbeddableMappingType.ConcreteEmbeddableType findSubtypeByDiscriminator(Object discriminatorValue)
- Specified by:
findSubtypeByDiscriminatorin interfaceEmbeddableMappingType
-
findSubtypeBySubclass
public EmbeddableMappingType.ConcreteEmbeddableType findSubtypeBySubclass(String subclassName)
- Specified by:
findSubtypeBySubclassin interfaceEmbeddableMappingType
-
getConcreteEmbeddableTypes
public Collection<EmbeddableMappingType.ConcreteEmbeddableType> getConcreteEmbeddableTypes()
Description copied from interface:EmbeddableMappingTypeReturns the concrete embeddable subtypes or an empty collection ifEmbeddableMappingType.isPolymorphic()isfalse.- Specified by:
getConcreteEmbeddableTypesin interfaceEmbeddableMappingType- Overrides:
getConcreteEmbeddableTypesin classAbstractEmbeddableMapping
-
getAttributeValues
protected Object[] getAttributeValues(Object compositeInstance)
- Overrides:
getAttributeValuesin classAbstractEmbeddableMapping
-
setAttributeValues
protected void setAttributeValues(Object component, Object[] values)
- Overrides:
setAttributeValuesin classAbstractEmbeddableMapping
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPartin interfaceModelPartContainer- Overrides:
findSubPartin classAbstractEmbeddableMapping
-
breakDownJdbcValues
public <X,Y> int breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Description copied from interface:ModelPartBreaks down the domain value to its constituent JDBC values. Think of it as breaking the multi-dimensional array into a visitable flat array. Additionally, it passes through the valuesXandYto the consumer. Returns the amount of jdbc types that have been visited.- Specified by:
breakDownJdbcValuesin interfaceModelPart- Overrides:
breakDownJdbcValuesin classAbstractEmbeddableMapping
-
forEachJdbcValue
public <X,Y> int forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)
Description copied from interface:BindableVisit each constituent JDBC value extracted from the entity instance itself. Short-hand form of callingBindable.disassemble(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor)and piping its result toBindable.forEachDisassembledJdbcValue(Object, int, JdbcValuesConsumer, SharedSessionContractImplementor)- Specified by:
forEachJdbcValuein interfaceBindable- Overrides:
forEachJdbcValuein classAbstractEmbeddableMapping
-
decompose
public <X,Y> int decompose(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Description copied from interface:ModelPartSimilar toModelPart.breakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor), but this method is supposed to be used for decomposing values for assignment expressions. Returns the amount of jdbc types that have been visited.
-
forEachInsertable
public void forEachInsertable(int offset, SelectableConsumer consumer)- Specified by:
forEachInsertablein interfaceEmbeddableMappingType
-
forEachUpdatable
public void forEachUpdatable(int offset, SelectableConsumer consumer)- Specified by:
forEachUpdatablein interfaceEmbeddableMappingType
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
isCreateEmptyCompositesEnabled
public boolean isCreateEmptyCompositesEnabled()
- Specified by:
isCreateEmptyCompositesEnabledin interfaceEmbeddableMappingType
-
getAggregateMapping
public SelectableMapping getAggregateMapping()
- Specified by:
getAggregateMappingin interfaceEmbeddableMappingType
-
requiresAggregateColumnWriter
public boolean requiresAggregateColumnWriter()
- Specified by:
requiresAggregateColumnWriterin interfaceEmbeddableMappingType
-
shouldSelectAggregateMapping
public boolean shouldSelectAggregateMapping()
- Specified by:
shouldSelectAggregateMappingin interfaceEmbeddableMappingType
-
shouldBindAggregateMapping
public boolean shouldBindAggregateMapping()
- Specified by:
shouldBindAggregateMappingin interfaceEmbeddableMappingType
-
-