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,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,NonAggregatedIdentifierMappingImpl,OneToManyCollectionPart,PluralAttributeMappingImpl,SimpleForeignKeyDescriptor,SimpleNaturalIdMapping,SingleTableEntityPersister,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 interfaceModelPart.JdbcValueBiConsumer<X,Y>Functional interface for consuming the JDBC values, along with two values of typeXandY.static interfaceModelPart.JdbcValueConsumerFunctional 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 voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.voidapplySqlSelections(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 booleanareEqual(Object one, Object other, SharedSessionContractImplementor session)default AttributeMappingasAttributeMapping()default @Nullable BasicValuedModelPartasBasicValuedModelPart()default EntityMappingTypeasEntityMappingType()<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 intbreakDownJdbcValues(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 valuesXandY.<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 intdecompose(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 valuesXandY.EntityMappingTypefindContainingEntityMapping()default intforEachSelectable(int offset, SelectableConsumer consumer)Visits each selectable mapping with the selectable index offset by the given value.default intforEachSelectable(SelectableConsumer consumer)A short hand form offorEachSelectable(int, SelectableConsumer), that passes 0 as offset.JavaType<?>getJavaType()The Java type for this part.NavigableRolegetNavigableRole()MappingTypegetPartMappingType()The type for this part.StringgetPartName()The local part name, which is generally the unqualified role namebooleanhasPartitionedSelectionMapping()default booleanisEntityIdentifierMapping()default booleanisVirtual()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, getJdbcMappings, 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 valuesXandY.
-
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 valuesXandYto 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 valuesXandY.
-
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(Object one, Object other, SharedSessionContractImplementor session)
-
-