Top Description Inners Methods
org.hibernate.metamodel.mapping

public Interface ModelPart

extends MappingModelExpressible
Known Direct Subinterfaces
org.hibernate.metamodel.mapping.ModelPartContainer, org.hibernate.metamodel.mapping.ValuedModelPart, org.hibernate.metamodel.mapping.VirtualModelPart, org.hibernate.sql.results.graph.Fetchable, org.hibernate.loader.ast.spi.Loadable, org.hibernate.metamodel.mapping.EntityAssociationMapping
Imports
java.util.Objects, java.util.function.BiConsumer, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.query.sqm.sql.internal.DomainResultProducer, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.spi.SqlSelection, org.hibernate.sql.ast.tree.from.TableGroup, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, org.hibernate.type.descriptor.java.JavaType, org.checkerframework.checker.nullness.qual.Nullable

Base descriptor, within the mapping model, for any part of the application's domain model: an attribute, an entity identifier, collection elements, and so on.
Author
Steve Ebersole
See Also
DomainResultProducer, jakarta.persistence.metamodel.Bindable

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ModelPart.JdbcValueBiConsumer<X, Y>

Functional interface for consuming the JDBC values, along with two values of type X and Y.

public static interface
ModelPart.JdbcValueConsumer

Functional interface for consuming the JDBC values.

Method Summary

Modifier and TypeMethod and Description
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

public default boolean
public default AttributeMapping
public default EntityMappingType
public default int
breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)

A short hand form of breakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor), that passes 0 as offset and null for the two values X and Y.

public <X, Y> int
breakDownJdbcValues(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.

public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Create a DomainResult for a specific reference to this ModelPart.

public default int
decompose(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)

A short hand form of decompose(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor), that passes 0 as offset and null for the two values X and Y.

public default <X, Y> int
decompose(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

Similar to breakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor), but this method is supposed to be used for decomposing values for assignment expressions.

public EntityMappingType
public default int
forEachSelectable(SelectableConsumer consumer)

A short hand form of forEachSelectable(int, SelectableConsumer), that passes 0 as offset.

public default int
forEachSelectable(int offset, SelectableConsumer consumer)

Visits each selectable mapping with the selectable index offset by the given value.

public JavaType<?>
getJavaType()

The Java type for this part.

public NavigableRole
public MappingType
getPartMappingType()

The type for this part.

public String
getPartName()

The local part name, which is generally the unqualified role name

public boolean
public default boolean
public default boolean
isVirtual()

Whether this model part describes something that physically exists in the domain model.

Method Detail

applySqlSelectionsback to summary
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

applySqlSelectionsback to summary
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

areEqualback to summary
public default boolean areEqual(@Nullable Object one, @Nullable Object other, SharedSessionContractImplementor session)
asAttributeMappingback to summary
public default AttributeMapping asAttributeMapping()
asEntityMappingTypeback to summary
public default EntityMappingType asEntityMappingType()
breakDownJdbcValuesback to summary
public default int breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)

A short hand form of breakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor), that passes 0 as offset and null for the two values X and Y.

breakDownJdbcValuesback to summary
public <X, Y> int breakDownJdbcValues(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. 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.

createDomainResultback to summary
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Create a DomainResult for a specific reference to this ModelPart.

decomposeback to summary
public default int decompose(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)

A short hand form of decompose(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor), that passes 0 as offset and null for the two values X and Y.

decomposeback to summary
public default <X, Y> int decompose(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

Similar to 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.

findContainingEntityMappingback to summary
public EntityMappingType findContainingEntityMapping()
forEachSelectableback to summary
public default int forEachSelectable(SelectableConsumer consumer)

A short hand form of forEachSelectable(int, SelectableConsumer), that passes 0 as offset.

forEachSelectableback to summary
public default int forEachSelectable(int offset, SelectableConsumer consumer)

Visits each selectable mapping with the selectable index offset by the given value. Returns the amount of jdbc types that have been visited.

getJavaTypeback to summary
public JavaType<?> getJavaType()

The Java type for this part. Generally equivalent to MappingType#getMappedJavaType() relative to getPartMappingType()

getNavigableRoleback to summary
public NavigableRole getNavigableRole()

API Note

Whereas getPartName() is local to this part, NavigableRole can be a compound path

See Also
getPartName()
getPartMappingTypeback to summary
public MappingType getPartMappingType()

The type for this part.

getPartNameback to summary
public String getPartName()

The local part name, which is generally the unqualified role name

hasPartitionedSelectionMappingback to summary
public boolean hasPartitionedSelectionMapping()
isEntityIdentifierMappingback to summary
public default boolean isEntityIdentifierMapping()
isVirtualback to summary
public default boolean isVirtual()

Whether this model part describes something that physically exists in the domain model.

For example, an entity's discriminator is part of the model, but is not a physical part of the domain model - there is no "discriminator attribute".

Also indicates whether the part is castable to VirtualModelPart

org.hibernate.metamodel.mapping back to summary

public Interface ModelPart.JdbcValueBiConsumer<X, Y>

Known Direct Subinterfaces
org.hibernate.metamodel.mapping.ModelPart.JdbcValueConsumer
Annotations
@FunctionalInterface

Functional interface for consuming the JDBC values, along with two values of type X and Y.

Method Summary

Modifier and TypeMethod and Description
public void
consume(int valueIndex, X x, Y y, Object value, SelectableMapping jdbcValueMapping)

Consume a JDBC-level jdbcValue.

Method Detail

consumeback to summary
public void consume(int valueIndex, X x, Y y, Object value, SelectableMapping jdbcValueMapping)

Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in

org.hibernate.metamodel.mapping back to summary

public Interface ModelPart.JdbcValueConsumer

extends ModelPart.JdbcValueBiConsumer<Object, Object>
Known Direct Implementers
org.hibernate.sql.model.ast.ColumnValueBindingList
Annotations
@FunctionalInterface

Functional interface for consuming the JDBC values.

Method Summary

Modifier and TypeMethod and Description
public default void
consume(int valueIndex, Object x, Object y, Object value, SelectableMapping jdbcValueMapping)

Implements org.hibernate.metamodel.mapping.ModelPart.JdbcValueBiConsumer.consume.

Consume a JDBC-level jdbcValue.
public void
consume(int valueIndex, Object value, SelectableMapping jdbcValueMapping)

Consume a JDBC-level jdbcValue.

Method Detail

consumeback to summary
public default void consume(int valueIndex, Object x, Object y, Object value, SelectableMapping jdbcValueMapping)

Implements org.hibernate.metamodel.mapping.ModelPart.JdbcValueBiConsumer.consume.

Doc from org.hibernate.metamodel.mapping.ModelPart.JdbcValueBiConsumer.consume.

Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in

Annotations
@Override
consumeback to summary
public void consume(int valueIndex, Object value, SelectableMapping jdbcValueMapping)

Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in