Package org.hibernate.metamodel.mapping
Interface EmbeddableValuedModelPart
-
- All Superinterfaces:
Bindable
,Fetchable
,FetchableContainer
,JavaTypedExpressible
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,ModelPartContainer
,SelectableMappings
,TableGroupJoinProducer
,TableGroupProducer
,ValuedModelPart
,ValueMapping
- All Known Subinterfaces:
CompositeIdentifierMapping
,EmbeddableValuedFetchable
,NonAggregatedIdentifierMapping
- All Known Implementing Classes:
AbstractCompositeIdentifierMapping
,AnonymousTupleEmbeddableValuedModelPart
,AnonymousTupleEmbeddedEntityIdentifierMapping
,AnonymousTupleNonAggregatedEntityIdentifierMapping
,EmbeddedAttributeMapping
,EmbeddedCollectionPart
,EmbeddedIdentifierMappingImpl
,InverseNonAggregatedIdentifierMapping
,NonAggregatedIdentifierMappingImpl
,VirtualEmbeddedAttributeMapping
public interface EmbeddableValuedModelPart extends ValuedModelPart, Fetchable, FetchableContainer, TableGroupJoinProducer
Describes the mapping of an embeddable (composite).- See Also:
Embedded
,EmbeddedId
,Embeddable
-
-
Nested Class Summary
-
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.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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.default <X,Y>
intbreakDownJdbcValues(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.default <X,Y>
intdecompose(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Similar toModelPart.breakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)
, but this method is supposed to be used for decomposing values for assignment expressions.default Object
disassemble(Object value, SharedSessionContractImplementor session)
Breaks down a value ofJ
into its simple pieces.default ModelPart
findSubPart(String name, EntityMappingType treatTargetType)
default <X,Y>
intforEachDisassembledJdbcValue(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)
.default void
forEachInsertable(SelectableConsumer consumer)
default int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Visit each JdbcMapping starting from the given offsetdefault <X,Y>
intforEachJdbcValue(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.default int
forEachSelectable(int offset, SelectableConsumer consumer)
Visits each selectable mapping with the selectable index offset by the given value.default void
forEachSubPart(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget)
default void
forEachUpdatable(SelectableConsumer consumer)
EmbeddableMappingType
getEmbeddableTypeDescriptor()
default Fetchable
getFetchable(int position)
default JavaType<?>
getJavaType()
The Java type for this part.default JdbcMapping
getJdbcMapping(int index)
default int
getJdbcTypeCount()
The number of JDBC mappingsdefault EmbeddableMappingType
getMappedType()
Descriptor for the type of this mappingdefault int
getNumberOfFetchables()
The number of fetchables in the containerdefault PropertyAccess
getParentInjectionAttributePropertyAccess()
default SelectableMapping
getSelectable(int columnIndex)
Get the selectable at the given positiondefault int
getSelectableIndex(String selectableName)
default boolean
hasPartitionedSelectionMapping()
SqlTuple
toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
default void
visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, generateFetch, getFetchableKey, getFetchableName, getMappedFetchOptions, incrementFetchDepth, isSelectable, resolveCircularFetch
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
applySqlSelections, applySqlSelections, areEqual, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, createDomainResult, decompose, findContainingEntityMapping, getNavigableRole, getPartMappingType, getPartName, isEntityIdentifierMapping, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
createRootTableGroupJoin, createTableGroupJoin, determineSqlJoinType, getDefaultSqlAstJoinType, isSimpleJoinPredicate
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference, getSqlAliasStem
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachNonFormula, forEachSelectable, getContainingTableExpression, getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Method Detail
-
getEmbeddableTypeDescriptor
EmbeddableMappingType getEmbeddableTypeDescriptor()
-
getMappedType
default EmbeddableMappingType getMappedType()
Description copied from interface:ValueMapping
Descriptor for the type of this mapping- Specified by:
getMappedType
in interfaceValueMapping
-
getJavaType
default JavaType<?> getJavaType()
Description copied from interface:ModelPart
The Java type for this part. Generally equivalent toMappingType.getMappedJavaType()
relative toModelPart.getPartMappingType()
- Specified by:
getJavaType
in interfaceModelPart
-
findSubPart
default ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPart
in interfaceModelPartContainer
-
forEachSubPart
default void forEachSubPart(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget)
- Specified by:
forEachSubPart
in interfaceModelPartContainer
-
visitSubParts
default void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
- Specified by:
visitSubParts
in interfaceModelPartContainer
-
getJdbcTypeCount
default int getJdbcTypeCount()
Description copied from interface:Bindable
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
- Specified by:
getJdbcTypeCount
in interfaceSelectableMappings
- Specified by:
getJdbcTypeCount
in interfaceValuedModelPart
-
getJdbcMapping
default JdbcMapping getJdbcMapping(int index)
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
forEachJdbcType
default int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
forEachJdbcValue
default <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
-
breakDownJdbcValues
default <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
-
decompose
default <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.
-
getNumberOfFetchables
default int getNumberOfFetchables()
Description copied from interface:FetchableContainer
The number of fetchables in the container- Specified by:
getNumberOfFetchables
in interfaceFetchableContainer
-
getFetchable
default Fetchable getFetchable(int position)
- Specified by:
getFetchable
in interfaceFetchableContainer
-
getSelectableIndex
default int getSelectableIndex(String selectableName)
- Specified by:
getSelectableIndex
in interfaceFetchableContainer
-
getSelectable
default SelectableMapping getSelectable(int columnIndex)
Description copied from interface:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceSelectableMappings
-
forEachSelectable
default int forEachSelectable(int offset, SelectableConsumer consumer)
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 interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- Specified by:
forEachSelectable
in interfaceValuedModelPart
- See Also:
SelectableConsumer.accept(int, SelectableMapping)
-
forEachInsertable
default void forEachInsertable(SelectableConsumer consumer)
- Specified by:
forEachInsertable
in interfaceValuedModelPart
-
forEachUpdatable
default void forEachUpdatable(SelectableConsumer consumer)
- Specified by:
forEachUpdatable
in interfaceValuedModelPart
-
hasPartitionedSelectionMapping
default boolean hasPartitionedSelectionMapping()
- Specified by:
hasPartitionedSelectionMapping
in interfaceModelPart
-
forEachDisassembledJdbcValue
default <X,Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)
Description copied from interface:Bindable
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)
.- Specified by:
forEachDisassembledJdbcValue
in interfaceBindable
-
disassemble
default Object disassemble(Object value, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Breaks down a value ofJ
into its simple pieces. E.g., an embedded value gets broken down into an array of its attribute state; a basic value converts to itself; etc.Generally speaking, this is the form in which entity state is kept relative to a Session via
EntityEntry
.@Entity class Person { @Id Integer id; @Embedded Name name; int age; } @Embeddable class Name { String familiarName; String familyName; }
At the top level, we would want to disassemble a
Person
value, so we'd ask theBindable
for thePerson
entity to disassemble. Given aPerson
value:Person( id=1, name=Name( 'Steve', 'Ebersole' ), 28 )
this disassemble would result in a multidimensional array:
[ ["Steve", "Ebersole"], 28 ]
Note that the identifier is not part of this disassembled state. Note also how the embedded value results in a sub-array.
- Specified by:
disassemble
in interfaceBindable
- See Also:
EntityEntry
-
addToCacheKey
default void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.- Specified by:
addToCacheKey
in interfaceBindable
- Specified by:
addToCacheKey
in interfaceJavaTypedExpressible
- Parameters:
cacheKey
- the MutableCacheKey used to add the disassembled value and the hashCodevalue
- the value to disassemblesession
- the SharedSessionContractImplementor
-
getParentInjectionAttributePropertyAccess
default PropertyAccess getParentInjectionAttributePropertyAccess()
- See Also:
Parent
-
toSqlExpression
SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
-
-