Top Description Inners Fields Constructors Methods
org.hibernate.metamodel.mapping.internal

public abstract Class AbstractEmbeddableMapping

extends Object
implements EmbeddableMappingType
Class Inheritance
All Implemented Interfaces
org.hibernate.metamodel.mapping.EmbeddableMappingType, org.hibernate.metamodel.mapping.SelectableMappings, org.hibernate.metamodel.mapping.ManagedMappingType, org.hibernate.sql.results.graph.FetchableContainer, org.hibernate.metamodel.mapping.ModelPartContainer, org.hibernate.metamodel.mapping.ModelPart, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.metamodel.mapping.MappingType
Known Direct Subclasses
org.hibernate.metamodel.mapping.internal.EmbeddableMappingTypeImpl, org.hibernate.metamodel.mapping.internal.IdClassEmbeddable, org.hibernate.metamodel.mapping.internal.VirtualIdEmbeddable
Imports
java.io.Serializable, java.util.List, .Locale, java.util.function.Consumer, org.hibernate.MappingException, .SharedSessionContract, org.hibernate.bytecode.spi.ReflectionOptimizer, org.hibernate.cache.MutableCacheKeyBuilder, org.hibernate.dialect.Dialect, org.hibernate.engine.FetchTiming, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment, org.hibernate.engine.jdbc.spi.JdbcServices, org.hibernate.engine.spi.CascadeStyle, .SharedSessionContractImplementor, org.hibernate.internal.util.IndexedConsumer, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.mapping.Any, .BasicValue, .Column, .Component, .Property, .Selectable, .Value, org.hibernate.metamodel.UnsupportedMappingException, org.hibernate.metamodel.mapping.AttributeMapping, .AttributeMappingsList, .EmbeddableMappingType, .EmbeddableValuedModelPart, .EntityMappingType, .ForeignKeyDescriptor, .JdbcMapping, .ManagedMappingType, .ModelPart, .PluralAttributeMapping, .SelectableConsumer, .SelectableMapping, .SelectableMappings, .SelectablePath, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.metamodel.spi.EmbeddableRepresentationStrategy, org.hibernate.persister.entity.EntityPersister, org.hibernate.property.access.internal.PropertyAccessStrategyBackRefImpl, org.hibernate.property.access.spi.Getter, .PropertyAccess, org.hibernate.sql.ast.tree.from.TableGroupProducer, org.hibernate.sql.results.graph.Fetchable, org.hibernate.type.AnyType, .BasicType, .CollectionType, .CompositeType, .EntityType, .Type, org.hibernate.type.descriptor.java.ImmutableMutabilityPlan, .JavaType, .MutabilityPlan, org.hibernate.type.spi.TypeConfiguration

Base support for EmbeddableMappingType implementations

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static interface
protected static interface
protected static class
protected static interface

Field Summary

Modifier and TypeField and Description
protected final MutableAttributeMappingList
attributeMappings

Deprecated as a consequence of MutableAttributeMappingList being deprecated.
protected SelectableMappings

Constructor Summary

AccessConstructor and Description
public
AbstractEmbeddableMapping(MutableAttributeMappingList attributeMappings)

Deprecated as a consequence of MutableAttributeMappingList being deprecated.

Method Summary

Modifier and TypeMethod and Description
protected void
addAttribute(AttributeMapping attributeMapping)

public void
addToCacheKey(MutableCacheKeyBuilder
the MutableCacheKey used to add the disassembled value and the hashCode
cacheKey
,
Object
the value to disassemble
value
,
SharedSessionContractImplementor
the SharedSessionContractImplementor
session
)

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.
public <X, Y> int
breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

Breaks down the domain value to its constituent JDBC values.
private void
public Object
disassemble(Object value, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.disassemble.

Breaks down a value of J into its simple pieces.
public AttributeMapping
public ModelPart
protected boolean
finishInitialization(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)

public void
forEachAttributeMapping(final IndexedConsumer<? super AttributeMapping> consumer)

Overrides default org.hibernate.metamodel.mapping.ManagedMappingType.forEachAttributeMapping.

Visit attributes defined on this class and any supers
public void
forEachAttributeMapping(final Consumer<? super AttributeMapping> action)

Implements org.hibernate.metamodel.mapping.ManagedMappingType.forEachAttributeMapping.

Visit attributes defined on this class and any supers
public <X, Y> int
public int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

Implements org.hibernate.metamodel.mapping.EmbeddableMappingType.forEachJdbcType.

Visit each JdbcMapping starting from the given offset
public <X, Y> int
forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue.

Visit each constituent JDBC value extracted from the entity instance itself.
public int
public int
forEachSelectable(int offset, SelectableConsumer consumer)

Implements org.hibernate.metamodel.mapping.EmbeddableMappingType.forEachSelectable.

Visit each contained selectable mapping.
public void
public AttributeMapping
getAttributeMapping(int position)

Implements org.hibernate.metamodel.mapping.ManagedMappingType.getAttributeMapping.

Retrieve an attribute by its contributor position
public AttributeMappingsList
getAttributeMappings()

Implements org.hibernate.metamodel.mapping.ManagedMappingType.getAttributeMappings.

Get access to the attributes defined on this class and any supers
public Fetchable
public JdbcMapping
public int
public JavaType<?>
private static MutabilityPlan<?>
getMutabilityPlan(boolean updateable)

public int
getNumberOfAttributeMappings()

Implements org.hibernate.metamodel.mapping.ManagedMappingType.getNumberOfAttributeMappings.

Get the number of attributes defined on this class and any supers
public int
public SelectableMapping
getSelectable(int columnIndex)

Implements org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Get the selectable at the given position
protected SelectableMappings
public Object[]
getValues(Object compositeInstance)

Implements org.hibernate.metamodel.mapping.ManagedMappingType.getValues.

Extract the individual attribute values from the entity instance
protected boolean
protected boolean
inverseInitializeCallback(TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableMappingType inverseMappingType, MappingModelCreationProcess creationProcess, ManagedMappingType declaringType, MutableAttributeMappingList mappings)

Deprecated as a consequence of MutableAttributeMappingList being deprecated.
public void
setValues(Object component, Object[] values)

Implements org.hibernate.metamodel.mapping.ManagedMappingType.setValues.

Inject the attribute values into the entity instance
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributeMappingsback to summary
protected final MutableAttributeMappingList attributeMappings

Deprecated

as a consequence of MutableAttributeMappingList being deprecated. See corresponding docs for further information.

selectableMappingsback to summary
protected SelectableMappings selectableMappings

Constructor Detail

AbstractEmbeddableMappingback to summary
public AbstractEmbeddableMapping(MutableAttributeMappingList attributeMappings)

Deprecated

as a consequence of MutableAttributeMappingList being deprecated. See corresponding docs for further information.

Method Detail

addAttributeback to summary
protected void addAttribute(AttributeMapping attributeMapping)
addToCacheKeyback to summary
public void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Doc from org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.

Parameters
cacheKey:MutableCacheKeyBuilder

the MutableCacheKey used to add the disassembled value and the hashCode

value:Object

the value to disassemble

session:SharedSessionContractImplementor

the SharedSessionContractImplementor

Annotations
@Override
breakDownJdbcValuesback to summary
public <X, Y> int breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

Doc from org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

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 values X and Y to the consumer. Returns the amount of jdbc types that have been visited.

Annotations
@Override
checkIsReadyback to summary
private void checkIsReady()
disassembleback to summary
public Object disassemble(Object value, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.disassemble.

Doc from org.hibernate.metamodel.mapping.Bindable.disassemble.

Breaks down a value of J 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 the Bindable for the Person entity to disassemble. Given a Person 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.

Annotations
@Override
findAttributeMappingback to summary
public AttributeMapping findAttributeMapping(String name)

Overrides default org.hibernate.metamodel.mapping.ManagedMappingType.findAttributeMapping.

Doc from org.hibernate.metamodel.mapping.ManagedMappingType.findAttributeMapping.

Find an attribute by name.

Returns:AttributeMapping

The named attribute, or null if no match was found

Annotations
@Override
findSubPartback to summary
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)

Implements org.hibernate.metamodel.mapping.ModelPartContainer.findSubPart.

Annotations
@Override
finishInitializationback to summary
protected boolean finishInitialization(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)
forEachAttributeMappingback to summary
public void forEachAttributeMapping(final IndexedConsumer<? super AttributeMapping> consumer)

Overrides default org.hibernate.metamodel.mapping.ManagedMappingType.forEachAttributeMapping.

Doc from org.hibernate.metamodel.mapping.ManagedMappingType.forEachAttributeMapping.

Visit attributes defined on this class and any supers

Annotations
@Override
forEachAttributeMappingback to summary
public void forEachAttributeMapping(final Consumer<? super AttributeMapping> action)

Implements org.hibernate.metamodel.mapping.ManagedMappingType.forEachAttributeMapping.

Doc from org.hibernate.metamodel.mapping.ManagedMappingType.forEachAttributeMapping.

Visit attributes defined on this class and any supers

Annotations
@Override
forEachDisassembledJdbcValueback to summary
public <X, Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.forEachDisassembledJdbcValue.

Doc from org.hibernate.metamodel.mapping.Bindable.forEachDisassembledJdbcValue.

Like forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), but additionally receives an offset by which the selectionIndex is incremented when calling JdbcValuesBiConsumer#consume(int, Object, Object, Object, JdbcMapping).

Annotations
@Override
forEachJdbcTypeback to summary
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

Implements org.hibernate.metamodel.mapping.EmbeddableMappingType.forEachJdbcType.

Doc from org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Visit each JdbcMapping starting from the given offset

Annotations
@Override
forEachJdbcValueback to summary
public <X, Y> int forEachJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue.

Doc from org.hibernate.metamodel.mapping.Bindable.forEachJdbcValue.

Visit each constituent JDBC value extracted from the entity instance itself. Short-hand form of calling disassemble and piping its result to forEachDisassembledJdbcValue(Object, int, JdbcValuesConsumer, SharedSessionContractImplementor)

Annotations
@Override
forEachSelectableback to summary
public int forEachSelectable(SelectableConsumer consumer)

Overrides default org.hibernate.metamodel.mapping.EmbeddableMappingType.forEachSelectable.

Doc from org.hibernate.metamodel.mapping.SelectableMappings.forEachSelectable.

Same as forEachSelectable(int, SelectableConsumer), with an implicit offset of `0`

Annotations
@Override
forEachSelectableback to summary
public int forEachSelectable(int offset, SelectableConsumer consumer)

Implements org.hibernate.metamodel.mapping.EmbeddableMappingType.forEachSelectable.

Doc from org.hibernate.metamodel.mapping.SelectableMappings.forEachSelectable.

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

Annotations
@Override
forEachSubPartback to summary
public void forEachSubPart(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget)

Implements org.hibernate.metamodel.mapping.ModelPartContainer.forEachSubPart.

Annotations
@Override
getAttributeMappingback to summary
public AttributeMapping getAttributeMapping(int position)

Implements org.hibernate.metamodel.mapping.ManagedMappingType.getAttributeMapping.

Doc from org.hibernate.metamodel.mapping.ManagedMappingType.getAttributeMapping.

Retrieve an attribute by its contributor position

Annotations
@Override
getAttributeMappingsback to summary
public AttributeMappingsList getAttributeMappings()

Implements org.hibernate.metamodel.mapping.ManagedMappingType.getAttributeMappings.

Doc from org.hibernate.metamodel.mapping.ManagedMappingType.getAttributeMappings.

Get access to the attributes defined on this class and any supers

Annotations
@Override
getFetchableback to summary
public Fetchable getFetchable(int position)

Overrides default org.hibernate.sql.results.graph.FetchableContainer.getFetchable.

Annotations
@Override
getJdbcMappingback to summary
public JdbcMapping getJdbcMapping(int index)

Implements org.hibernate.metamodel.mapping.JdbcMappingContainer.getJdbcMapping.

Annotations
@Override
getJdbcTypeCountback to summary
public int getJdbcTypeCount()

Implements org.hibernate.metamodel.mapping.EmbeddableMappingType.getJdbcTypeCount.

Doc from org.hibernate.metamodel.mapping.SelectableMappings.getJdbcTypeCount.

The number of selectables

Annotations
@Override
getMappedJavaTypeback to summary
public JavaType<?> getMappedJavaType()

Implements org.hibernate.metamodel.mapping.MappingType.getMappedJavaType.

Doc from org.hibernate.metamodel.mapping.MappingType.getMappedJavaType.

The descriptor descriptor for the mapped Java type

Annotations
@Override
getMutabilityPlanback to summary
private static MutabilityPlan<?> getMutabilityPlan(boolean updateable)
getNumberOfAttributeMappingsback to summary
public int getNumberOfAttributeMappings()

Implements org.hibernate.metamodel.mapping.ManagedMappingType.getNumberOfAttributeMappings.

Doc from org.hibernate.metamodel.mapping.ManagedMappingType.getNumberOfAttributeMappings.

Get the number of attributes defined on this class and any supers

Annotations
@Override
getNumberOfFetchablesback to summary
public int getNumberOfFetchables()

Implements org.hibernate.sql.results.graph.FetchableContainer.getNumberOfFetchables.

Doc from org.hibernate.sql.results.graph.FetchableContainer.getNumberOfFetchables.

The number of fetchables in the container

Annotations
@Override
getSelectableback to summary
public SelectableMapping getSelectable(int columnIndex)

Implements org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Doc from org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Get the selectable at the given position

Annotations
@Override
getSelectableMappingsback to summary
protected SelectableMappings getSelectableMappings()
getValuesback to summary
public Object[] getValues(Object compositeInstance)

Implements org.hibernate.metamodel.mapping.ManagedMappingType.getValues.

Doc from org.hibernate.metamodel.mapping.ManagedMappingType.getValues.

Extract the individual attribute values from the entity instance

Annotations
@Override
initColumnMappingsback to summary
protected boolean initColumnMappings()
inverseInitializeCallbackback to summary
protected boolean inverseInitializeCallback(TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableMappingType inverseMappingType, MappingModelCreationProcess creationProcess, ManagedMappingType declaringType, MutableAttributeMappingList mappings)

Deprecated

as a consequence of MutableAttributeMappingList being deprecated. See corresponding docs for further information.

setValuesback to summary
public void setValues(Object component, Object[] values)

Implements org.hibernate.metamodel.mapping.ManagedMappingType.setValues.

Doc from org.hibernate.metamodel.mapping.ManagedMappingType.setValues.

Inject the attribute values into the entity instance

Annotations
@Override
visitFetchablesback to summary
public void visitFetchables(Consumer<? super Fetchable> consumer, EntityMappingType treatTargetType)

Overrides default org.hibernate.sql.results.graph.FetchableContainer.visitFetchables.

Annotations
@Override
visitFetchablesback to summary
public void visitFetchables(IndexedConsumer<? super Fetchable> indexedConsumer, EntityMappingType treatTargetType)

Overrides default org.hibernate.sql.results.graph.FetchableContainer.visitFetchables.

Annotations
@Override
visitSubPartsback to summary
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)

Implements org.hibernate.metamodel.mapping.ModelPartContainer.visitSubParts.

Annotations
@Override
org.hibernate.metamodel.mapping.internal back to summary

protected Interface AbstractEmbeddableMapping.AttributeTypeValidator

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void
check(String name, Type type)

Method Detail

checkback to summary
public void check(String name, Type type) throws IllegalAttributeType
org.hibernate.metamodel.mapping.internal back to summary

protected Interface AbstractEmbeddableMapping.ConcreteTableResolver

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public String
resolve(Column column, JdbcEnvironment jdbcEnvironment)

Method Detail

resolveback to summary
public String resolve(Column column, JdbcEnvironment jdbcEnvironment)
org.hibernate.metamodel.mapping.internal back to summary

protected Class AbstractEmbeddableMapping.IllegalAttributeType

extends RuntimeException
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Constructor Detail

IllegalAttributeTypeback to summary
public IllegalAttributeType(String message)
org.hibernate.metamodel.mapping.internal back to summary

protected Interface AbstractEmbeddableMapping.SuccessfulCompletionCallback

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void

Method Detail

successback to summary
public void success()