Class EmbeddableMappingTypeImpl
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
-
- org.hibernate.metamodel.mapping.internal.EmbeddableMappingTypeImpl
-
- All Implemented Interfaces:
Bindable
,EmbeddableMappingType
,JdbcMappingContainer
,ManagedMappingType
,MappingModelExpressible
,MappingType
,ModelPart
,ModelPartContainer
,Queryable
,SelectableMappings
,FetchableContainer
public class EmbeddableMappingTypeImpl extends AbstractEmbeddableMapping implements SelectableMappings
Describes a "normal" embeddable. NOTE: At the moment, this class is used to describe some non-normal cases: mainly composite fks
-
-
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.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueConsumer
-
-
Constructor Summary
Constructors Constructor Description EmbeddableMappingTypeImpl(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableMappingType inverseMappingType, MappingModelCreationProcess creationProcess)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
<T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Create a DomainResult for a specific reference to this ModelPart.EmbeddableMappingType
createInverseMappingType(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess)
Object
disassemble(Object value, SharedSessionContractImplementor session)
AttributeMapping
findAttributeMapping(String name)
EntityMappingType
findContainingEntityMapping()
ModelPart
findSubPart(String name, EntityMappingType treatTargetType)
For an entity, this form allows for Hibernate's "implicit treat" support - meaning it should find a sub-part whether defined on the entity, its super-type or even one of its sub-types.void
forEachAttributeMapping(IndexedConsumer<AttributeMapping> consumer)
Visit attributes defined on this class and any supersint
forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Visit each JdbcMapping starting from the given offsetint
forEachJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer consumer, SharedSessionContractImplementor session)
int
forEachSelectable(int offset, SelectableConsumer consumer)
Visit each contained selectable mapping.int
forEachSelectable(SelectableConsumer consumer)
Same asSelectableMappings.forEachSelectable(int, SelectableConsumer)
, with an implicit offset of `0`static EmbeddableMappingTypeImpl
from(Component bootDescriptor, CompositeType compositeType, String rootTableExpression, String[] rootTableKeyColumnNames, Property componentProperty, DependantValue dependantValue, int dependantColumnIndex, Function<EmbeddableMappingType,EmbeddableValuedModelPart> embeddedPartBuilder, MappingModelCreationProcess creationProcess)
static EmbeddableMappingTypeImpl
from(Component bootDescriptor, CompositeType compositeType, Function<EmbeddableMappingType,EmbeddableValuedModelPart> embeddedPartBuilder, MappingModelCreationProcess creationProcess)
AttributeMapping
getAttributeMapping(int position)
Retrieve an attribute by its contributor positionList<AttributeMapping>
getAttributeMappings()
Get access to the attributes defined on this class and any supersEmbeddableValuedModelPart
getEmbeddedValueMapping()
Fetchable
getFetchable(int position)
List<JdbcMapping>
getJdbcMappings()
Obtain the JdbcMappings for the underlying selectable mappingsint
getJdbcTypeCount()
The number of selectablesJavaType<?>
getMappedJavaType()
NavigableRole
getNavigableRole()
int
getNumberOfAttributeMappings()
Get the number of attributes defined on this class and any supersint
getNumberOfFetchables()
The number of fetchables in the containerString
getPartName()
EmbeddableRepresentationStrategy
getRepresentationStrategy()
SelectableMapping
getSelectable(int columnIndex)
Get the selectable at the given positionboolean
isCreateEmptyCompositesEnabled()
void
visitAttributeMappings(Consumer<? super AttributeMapping> action)
Visit attributes defined on this class and any supersvoid
visitFetchables(Consumer<Fetchable> fetchableConsumer, EntityMappingType treatTargetType)
void
visitFetchables(IndexedConsumer<Fetchable> fetchableConsumer, EntityMappingType treatTargetType)
void
visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
LikeQueryable.findSubPart(java.lang.String, org.hibernate.metamodel.mapping.EntityMappingType)
, this form visits all parts defined on the entity, its super-types and its sub-types.-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
finishInitialization, getValues, inverseInitializeCallback, setValues
-
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.EmbeddableMappingType
applySqlSelections, applySqlSelections
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfKeyFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
getJavaType, getPartMappingType, getValue, setValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.Queryable
findByPath, findSubTypesSubPart, resolveSubPart
-
-
-
-
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, 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, 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
-
getMappedJavaType
public JavaType<?> getMappedJavaType()
- Specified by:
getMappedJavaType
in interfaceMappingType
- Overrides:
getMappedJavaType
in classAbstractEmbeddableMapping
-
getRepresentationStrategy
public EmbeddableRepresentationStrategy getRepresentationStrategy()
- Specified by:
getRepresentationStrategy
in interfaceEmbeddableMappingType
-
getPartName
public String getPartName()
- 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
-
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
-
visitFetchables
public void visitFetchables(Consumer<Fetchable> fetchableConsumer, EntityMappingType treatTargetType)
- Specified by:
visitFetchables
in interfaceFetchableContainer
-
visitFetchables
public void visitFetchables(IndexedConsumer<Fetchable> fetchableConsumer, EntityMappingType treatTargetType)
- Specified by:
visitFetchables
in interfaceFetchableContainer
-
getSelectable
public SelectableMapping getSelectable(int columnIndex)
Description copied from interface:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceSelectableMappings
-
getJdbcTypeCount
public int getJdbcTypeCount()
Description copied from interface:SelectableMappings
The number of selectables- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceEmbeddableMappingType
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
- Specified by:
getJdbcTypeCount
in interfaceSelectableMappings
-
getJdbcMappings
public List<JdbcMapping> getJdbcMappings()
Description copied from interface:SelectableMappings
Obtain the JdbcMappings for the underlying selectable mappings- Specified by:
getJdbcMappings
in interfaceBindable
- Specified by:
getJdbcMappings
in interfaceEmbeddableMappingType
- Specified by:
getJdbcMappings
in interfaceJdbcMappingContainer
- Specified by:
getJdbcMappings
in interfaceSelectableMappings
- See Also:
SqlTypedMapping.getJdbcMapping()
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceEmbeddableMappingType
- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValues
in interfaceModelPart
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemble
in interfaceBindable
- See Also:
As an example, consider the following domain model: ````
-
forEachJdbcValue
public int forEachJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer consumer, SharedSessionContractImplementor session)
- Specified by:
forEachJdbcValue
in interfaceBindable
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValue
in interfaceBindable
-
forEachSelectable
public int forEachSelectable(SelectableConsumer consumer)
Description copied from interface:SelectableMappings
Same asSelectableMappings.forEachSelectable(int, SelectableConsumer)
, with an implicit offset of `0`- Specified by:
forEachSelectable
in interfaceEmbeddableMappingType
- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer consumer)
Description copied from interface:SelectableMappings
Visit each contained selectable mapping. As the selectables are iterated, we call `SelectionConsumer` passing along `offset` + our current iteration index. The return is the number of selectables we directly contain- Specified by:
forEachSelectable
in interfaceEmbeddableMappingType
- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- See Also:
SelectableConsumer.accept(int, SelectableMapping)
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
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
public AttributeMapping getAttributeMapping(int position)
Description copied from interface:ManagedMappingType
Retrieve an attribute by its contributor position- Specified by:
getAttributeMapping
in interfaceManagedMappingType
-
findAttributeMapping
public AttributeMapping findAttributeMapping(String name)
- Specified by:
findAttributeMapping
in interfaceManagedMappingType
-
getAttributeMappings
public List<AttributeMapping> getAttributeMappings()
Description copied from interface:ManagedMappingType
Get access to the attributes defined on this class and any supers- Specified by:
getAttributeMappings
in interfaceManagedMappingType
-
forEachAttributeMapping
public void forEachAttributeMapping(IndexedConsumer<AttributeMapping> consumer)
Description copied from interface:ManagedMappingType
Visit attributes defined on this class and any supers- Specified by:
forEachAttributeMapping
in interfaceManagedMappingType
-
visitAttributeMappings
public void visitAttributeMappings(Consumer<? super AttributeMapping> action)
Description copied from interface:ManagedMappingType
Visit attributes defined on this class and any supers- Specified by:
visitAttributeMappings
in interfaceManagedMappingType
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
Description copied from interface:Queryable
For an entity, this form allows for Hibernate's "implicit treat" support - meaning it should find a sub-part whether defined on the entity, its super-type or even one of its sub-types.- Specified by:
findSubPart
in interfaceQueryable
-
visitSubParts
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
Description copied from interface:Queryable
LikeQueryable.findSubPart(java.lang.String, org.hibernate.metamodel.mapping.EntityMappingType)
, this form visits all parts defined on the entity, its super-types and its sub-types.- Specified by:
visitSubParts
in interfaceQueryable
-
isCreateEmptyCompositesEnabled
public boolean isCreateEmptyCompositesEnabled()
- Specified by:
isCreateEmptyCompositesEnabled
in interfaceEmbeddableMappingType
-
-