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:
createInverseMappingType
in interfaceEmbeddableMappingType
-
getEmbeddedValueMapping
public EmbeddableValuedModelPart getEmbeddedValueMapping()
- Specified by:
getEmbeddedValueMapping
in interfaceEmbeddableMappingType
-
getDiscriminatorMapping
public EmbeddableDiscriminatorMapping getDiscriminatorMapping()
Description copied from interface:EmbeddableMappingType
Returns the discriminator mapping if this discriminator type is polymorphic,null
otherwise.- Specified by:
getDiscriminatorMapping
in interfaceEmbeddableMappingType
-
getMappedJavaType
public JavaType<?> getMappedJavaType()
Description copied from interface:MappingType
The descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaType
in interfaceMappingType
- Overrides:
getMappedJavaType
in classAbstractEmbeddableMapping
-
getRepresentationStrategy
public EmbeddableRepresentationStrategy getRepresentationStrategy()
- Specified by:
getRepresentationStrategy
in interfaceEmbeddableMappingType
-
getPartName
public String getPartName()
Description copied from interface:ModelPart
The local part name, which is generally the unqualified role name- Specified by:
getPartName
in interfaceModelPart
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRole
in interfaceModelPart
- See Also:
ModelPart.getPartName()
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Create a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResult
in interfaceEmbeddableMappingType
- Specified by:
createDomainResult
in interfaceModelPart
-
findSubtypeByDiscriminator
public EmbeddableMappingType.ConcreteEmbeddableType findSubtypeByDiscriminator(Object discriminatorValue)
- Specified by:
findSubtypeByDiscriminator
in interfaceEmbeddableMappingType
-
findSubtypeBySubclass
public EmbeddableMappingType.ConcreteEmbeddableType findSubtypeBySubclass(String subclassName)
- Specified by:
findSubtypeBySubclass
in interfaceEmbeddableMappingType
-
getConcreteEmbeddableTypes
public Collection<EmbeddableMappingType.ConcreteEmbeddableType> getConcreteEmbeddableTypes()
Description copied from interface:EmbeddableMappingType
Returns the concrete embeddable subtypes or an empty collection ifEmbeddableMappingType.isPolymorphic()
isfalse
.- Specified by:
getConcreteEmbeddableTypes
in interfaceEmbeddableMappingType
- Overrides:
getConcreteEmbeddableTypes
in classAbstractEmbeddableMapping
-
getAttributeValues
protected Object[] getAttributeValues(Object compositeInstance)
- Overrides:
getAttributeValues
in classAbstractEmbeddableMapping
-
setAttributeValues
protected void setAttributeValues(Object component, Object[] values)
- Overrides:
setAttributeValues
in classAbstractEmbeddableMapping
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPart
in interfaceModelPartContainer
- Overrides:
findSubPart
in 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:ModelPart
Breaks 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 valuesX
andY
to the consumer. Returns the amount of jdbc types that have been visited.- Specified by:
breakDownJdbcValues
in interfaceModelPart
- Overrides:
breakDownJdbcValues
in 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:Bindable
Visit 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:
forEachJdbcValue
in interfaceBindable
- Overrides:
forEachJdbcValue
in 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:ModelPart
Similar 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:
forEachInsertable
in interfaceEmbeddableMappingType
-
forEachUpdatable
public void forEachUpdatable(int offset, SelectableConsumer consumer)
- Specified by:
forEachUpdatable
in interfaceEmbeddableMappingType
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
isCreateEmptyCompositesEnabled
public boolean isCreateEmptyCompositesEnabled()
- Specified by:
isCreateEmptyCompositesEnabled
in interfaceEmbeddableMappingType
-
getAggregateMapping
public SelectableMapping getAggregateMapping()
- Specified by:
getAggregateMapping
in interfaceEmbeddableMappingType
-
requiresAggregateColumnWriter
public boolean requiresAggregateColumnWriter()
- Specified by:
requiresAggregateColumnWriter
in interfaceEmbeddableMappingType
-
shouldSelectAggregateMapping
public boolean shouldSelectAggregateMapping()
- Specified by:
shouldSelectAggregateMapping
in interfaceEmbeddableMappingType
-
shouldBindAggregateMapping
public boolean shouldBindAggregateMapping()
- Specified by:
shouldBindAggregateMapping
in interfaceEmbeddableMappingType
-
-