Package org.hibernate.metamodel.mapping
Interface ModelPart
-
- All Superinterfaces:
Bindable
,JdbcMappingContainer
,MappingModelExpressible
- All Known Subinterfaces:
AggregatedIdentifierMapping
,Association
,AttributeMapping
,BasicEntityIdentifierMapping
,BasicValuedModelPart
,CollectionIdentifierDescriptor
,CollectionPart
,CompositeIdentifierMapping
,DatabaseSnapshotContributor
,DeprecatedEntityStuff
,DiscriminatedAssociationModelPart
,DiscriminatorMapping
,EmbeddableMappingType
,EmbeddableValuedFetchable
,EmbeddableValuedModelPart
,EntityAssociationMapping
,EntityCollectionPart
,EntityDiscriminatorMapping
,EntityIdentifierMapping
,EntityMappingType
,EntityPersister
,EntityRowIdMapping
,EntityValuedFetchable
,EntityValuedModelPart
,EntityVersionMapping
,Fetchable
,FetchableContainer
,ForeignKeyDescriptor
,InFlightEntityMappingType
,Loadable
,Loadable
,Lockable
,ManagedMappingType
,ModelPartContainer
,NaturalIdMapping
,NonAggregatedIdentifierMapping
,NonAggregatedIdentifierMapping.IdentifierValueMapper
,OuterJoinLoadable
,OwnedValuedModelPart
,PluralAttributeMapping
,PostInsertIdentityPersister
,Queryable
,RootTableGroupProducer
,SingleAttributeIdentifierMapping
,SingularAttributeMapping
,SoftDeletableModelPart
,SoftDeleteMapping
,SQLLoadable
,TableGroupJoinProducer
,TableGroupProducer
,UniqueKeyLoadable
,ValuedModelPart
,VirtualModelPart
- All Known Implementing Classes:
AbstractAttributeMapping
,AbstractCompositeIdentifierMapping
,AbstractDiscriminatorMapping
,AbstractEmbeddableMapping
,AbstractEntityCollectionPart
,AbstractEntityPersister
,AbstractNaturalIdMapping
,AbstractSingularAttributeMapping
,AbstractStateArrayContributorMapping
,AnonymousTupleBasicEntityIdentifierMapping
,AnonymousTupleBasicValuedModelPart
,AnonymousTupleEmbeddableValuedModelPart
,AnonymousTupleEmbeddedEntityIdentifierMapping
,AnonymousTupleEntityValuedModelPart
,AnonymousTupleNonAggregatedEntityIdentifierMapping
,AnonymousTupleTableGroupProducer
,AnyDiscriminatorPart
,AnyKeyPart
,BasicAttributeMapping
,BasicEntityIdentifierMappingImpl
,BasicValuedCollectionPart
,CaseStatementDiscriminatorMappingImpl
,CollectionIdentifierDescriptorImpl
,CompoundNaturalIdMapping
,CteTupleTableGroupProducer
,DiscriminatedAssociationAttributeMapping
,DiscriminatedCollectionPart
,EmbeddableMappingTypeImpl
,EmbeddedAttributeMapping
,EmbeddedCollectionPart
,EmbeddedForeignKeyDescriptor
,EmbeddedIdentifierMappingImpl
,EntityRowIdMappingImpl
,EntityVersionMappingImpl
,ExplicitColumnDiscriminatorMappingImpl
,IdClassEmbeddable
,InverseNonAggregatedIdentifierMapping
,JoinedSubclassEntityPersister
,ManyToManyCollectionPart
,MockEntityPersister
,NonAggregatedIdentifierMappingImpl
,OneToManyCollectionPart
,PluralAttributeMappingImpl
,ProcessorSessionFactory.EntityPersister
,SimpleForeignKeyDescriptor
,SimpleNaturalIdMapping
,SingleTableEntityPersister
,SoftDeleteMappingImpl
,ToOneAttributeMapping
,UnionSubclassEntityPersister
,VirtualEmbeddedAttributeMapping
,VirtualIdEmbeddable
public interface ModelPart extends MappingModelExpressible
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.- See Also:
DomainResultProducer
,Bindable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ModelPart.JdbcValueBiConsumer<X,Y>
Functional interface for consuming the JDBC values, along with two values of typeX
andY
.static interface
ModelPart.JdbcValueConsumer
Functional interface for consuming the JDBC values.-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,Y>, Bindable.JdbcValuesConsumer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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.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.default boolean
areEqual(@Nullable Object one, @Nullable Object other, SharedSessionContractImplementor session)
default AttributeMapping
asAttributeMapping()
default @Nullable BasicValuedModelPart
asBasicValuedModelPart()
default EntityMappingType
asEntityMappingType()
<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 int
breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
A short hand form ofbreakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)
, that passes 0 as offset and null for the two valuesX
andY
.<T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Create a DomainResult for a specific reference to this ModelPart.default <X,Y>
intdecompose(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Similar tobreakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)
, but this method is supposed to be used for decomposing values for assignment expressions.default int
decompose(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
A short hand form ofdecompose(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)
, that passes 0 as offset and null for the two valuesX
andY
.EntityMappingType
findContainingEntityMapping()
default int
forEachSelectable(int offset, SelectableConsumer consumer)
Visits each selectable mapping with the selectable index offset by the given value.default int
forEachSelectable(SelectableConsumer consumer)
A short hand form offorEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.JavaType<?>
getJavaType()
The Java type for this part.NavigableRole
getNavigableRole()
MappingType
getPartMappingType()
The type for this part.String
getPartName()
The local part name, which is generally the unqualified role nameboolean
hasPartitionedSelectionMapping()
default boolean
isEntityIdentifierMapping()
default boolean
isVirtual()
Whether this model part describes something that physically exists in the domain model.-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
addToCacheKey, disassemble, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, getJdbcTypeCount
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
forEachJdbcType, getJdbcMapping, getSingleJdbcMapping
-
-
-
-
Method Detail
-
getNavigableRole
NavigableRole getNavigableRole()
- See Also:
getPartName()
- API Note:
- Whereas
getPartName()
is local to this part, NavigableRole can be a compound path
-
getPartName
String getPartName()
The local part name, which is generally the unqualified role name
-
getPartMappingType
MappingType getPartMappingType()
The type for this part.
-
getJavaType
JavaType<?> getJavaType()
The Java type for this part. Generally equivalent toMappingType.getMappedJavaType()
relative togetPartMappingType()
-
isVirtual
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 toVirtualModelPart
-
isEntityIdentifierMapping
default boolean isEntityIdentifierMapping()
-
hasPartitionedSelectionMapping
boolean hasPartitionedSelectionMapping()
-
createDomainResult
<T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Create a DomainResult for a specific reference to this ModelPart.
-
applySqlSelections
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.
-
applySqlSelections
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.
-
forEachSelectable
default int forEachSelectable(SelectableConsumer consumer)
A short hand form offorEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.
-
forEachSelectable
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.
-
asAttributeMapping
default AttributeMapping asAttributeMapping()
-
asEntityMappingType
default EntityMappingType asEntityMappingType()
-
asBasicValuedModelPart
default @Nullable BasicValuedModelPart asBasicValuedModelPart()
-
breakDownJdbcValues
default int breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
A short hand form ofbreakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)
, that passes 0 as offset and null for the two valuesX
andY
.
-
breakDownJdbcValues
<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 valuesX
andY
to the consumer. Returns the amount of jdbc types that have been visited.
-
decompose
default int decompose(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
A short hand form ofdecompose(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)
, that passes 0 as offset and null for the two valuesX
andY
.
-
decompose
default <X,Y> int decompose(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Similar tobreakDownJdbcValues(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.
-
findContainingEntityMapping
EntityMappingType findContainingEntityMapping()
-
areEqual
default boolean areEqual(@Nullable Object one, @Nullable Object other, SharedSessionContractImplementor session)
-
-