Package org.hibernate.query.derived
Class AnonymousTupleEntityValuedModelPart
java.lang.Object
org.hibernate.query.derived.AnonymousTupleEntityValuedModelPart
- All Implemented Interfaces:
Loadable
,Bindable
,Discriminable
,EntityMappingType
,EntityValuedModelPart
,FilterRestrictable
,JdbcMappingContainer
,ManagedMappingType
,MappingModelExpressible
,MappingType
,ModelPart
,ModelPartContainer
,Restrictable
,SelectableMappings
,SoftDeletableModelPart
,ValuedModelPart
,ValueMapping
,WhereRestrictable
,LazyTableGroup.ParentTableGroupUseChecker
,RootTableGroupProducer
,TableGroupJoinProducer
,TableGroupProducer
,FetchableContainer
,JavaTypedExpressible
@Incubating
public class AnonymousTupleEntityValuedModelPart
extends Object
implements EntityValuedModelPart, EntityMappingType, TableGroupJoinProducer, ValuedModelPart, LazyTableGroup.ParentTableGroupUseChecker
-
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.EntityMappingType
EntityMappingType.ConstraintOrderedTableConsumer
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,
Y>, ModelPart.JdbcValueConsumer -
Constructor Summary
ConstructorsConstructorDescriptionAnonymousTupleEntityValuedModelPart
(EntityIdentifierMapping identifierMapping, DomainType<?> domainType, EntityValuedModelPart delegate, int fetchableIndex) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.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.<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.boolean
canUseParentTableGroup
(TableGroupProducer producer, NavigablePath navigablePath, ValuedModelPart valuedModelPart) boolean
containsTableReference
(String tableExpression) <T> DomainResult<T>
createDomainResult
(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState) Create a DomainResult for a specific reference to this ModelPart.createRootTableGroupJoin
(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType sqlAstJoinType, boolean fetched, @Nullable Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState) Create the "join", but return a TableGroup.createTableGroupInternal
(boolean canUseInnerJoins, NavigablePath navigablePath, boolean fetched, String sourceAlias, SqlAliasBase sqlAliasBase, SqlAstCreationState creationState) createTableGroupJoin
(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState) Create a TableGroupJoin.disassemble
(Object value, SharedSessionContractImplementor session) Breaks down a value ofJ
into its simple pieces.Find an attribute-mapping, declared on this entity mapping (not super or subs), by namefindSubPart
(String name, EntityMappingType treatTargetType) void
forEachAttributeMapping
(Consumer<? super AttributeMapping> action) Visit each attribute mapping<X,
Y> int forEachDisassembledJdbcValue
(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)
.int
forEachJdbcType
(int offset, IndexedConsumer<JdbcMapping> action) Visit each JdbcMapping starting from the given offset<X,
Y> int forEachJdbcValue
(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> consumer, SharedSessionContractImplementor session) Visit each constituent JDBC value extracted from the entity instance itself.int
forEachSelectable
(int offset, SelectableConsumer consumer) Visits each selectable mapping with the selectable index offset by the given value.int
forEachSelectable
(SelectableConsumer consumer) A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.getAttributeMapping
(int position) Retrieve an attribute mapping by position, relative to all attributesThe attributes mapping for this entity, including those declared on supertype mappingsint
The table which contains the columns mapped by this valueGet access to the attributes defined on this class - do not access attributes defined on the supergetDefaultSqlAstJoinType
(TableGroup parentTableGroup) Mapping details for the entity's discriminator.The discriminator value which indicates this entity mappingThe descriptor of the entity that is the type for this partThe entity name.Safety-net.Mapping details for the entity's identifier.Details for the table that defines the identifier column(s) for an entity hierarchy.JavaType<?>
The Java type for this part.getJdbcMapping
(int index) int
The number of JDBC mappingsJavaType<?>
The descriptor descriptor for the mapped Java typeDetails for the table this entity maps.Descriptor for the type of this mappingAccess to performing multi-value natural-id database selection.Access to performing natural-id database selection.The mapping for the natural-id of the entity, if one is definedint
The total number of attributes for this entity, including those declared on supertype mappingsint
The number of fetchables in the containerThe type for this part.The local part name, which is generally the unqualified role nameThe mapping for the row-id of the entity, if one is defined.getSelectable
(int columnIndex) Get the selectable at the given positionMapping for soft-delete support, ornull
if soft-delete not definedGet the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedExtract a specific attribute value from the entity instance, by positionObject[]
Extract the individual attribute values from the entity instanceMapping details for the entity's version when using the version strategy.boolean
isAffectedByEnabledFilters
(LoadQueryInfluencers influencers, boolean onlyApplyForLoadByKeyFilters) Whether any of the "influencers" affect this loadable.boolean
isAffectedByInfluencers
(LoadQueryInfluencers influencers) boolean
Is this class explicit polymorphism only?boolean
isNotAffectedByInfluencers
(LoadQueryInfluencers influencers) boolean
isSimpleJoinPredicate
(Predicate predicate) Returns whether the given predicate is a simple join predicate for this attribute.loadByUniqueKey
(String propertyName, Object uniqueKey, SharedSessionContractImplementor session) Load an instance of the persistent class, by a unique key other than the primary key.The type of optimistic locking, if any, defined for this entity mappingvoid
Inject a specific attribute value into the entity instance, by positionvoid
Inject the attribute values into the entity instancevoid
void
visitDeclaredAttributeMappings
(Consumer<? super AttributeMapping> action) Visit attributes defined on this class - do not visit attributes defined on the supervoid
visitQuerySpaces
(Consumer<String> querySpaceConsumer) Visit each "query space" for the mapped entity.void
visitSubParts
(Consumer<ModelPart> consumer, EntityMappingType treatTargetType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
Methods inherited from interface org.hibernate.metamodel.mapping.EntityMappingType
applyBaseRestrictions, applyDiscriminator, applyFilterRestrictions, applyWhereRestrictions, asEntityMappingType, createPrimaryTableReference, createRootTableGroup, createTableReferenceJoin, extractConcreteTypeStateValues, findSubPart, findSubTypesSubPart, getContributor, getFetchable, getIdentifierMappingForJoin, getImportedName, getMappedSuperclass, getNumberOfDeclaredAttributeMappings, getRepresentationStrategy, getRootEntityDescriptor, getRootPathName, getSqmMultiTableInsertStrategy, getSqmMultiTableMutationStrategy, getSubclassEntityNames, getSubclassId, getSubMappingTypes, getSuperMappingType, hasSubclasses, hasWhereRestrictions, isAbstract, isAffectedByEnabledFetchProfiles, isAffectedByEntityGraph, isConcreteProxy, isTypeOrSuperType, isTypeOrSuperType, pruneForSubclasses, resolveConcreteProxyTypeForId, visitAttributeMappings, visitSubTypeAttributeMappings, visitSuperTypeAttributeMappings
Methods inherited from interface org.hibernate.metamodel.mapping.EntityValuedModelPart
forEachSubPart
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
Methods inherited from interface org.hibernate.metamodel.mapping.FilterRestrictable
applyFilterRestrictions
Methods inherited from interface org.hibernate.loader.ast.spi.Loadable
isAffectedByEnabledFilters, isAffectedByInfluencers
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
anyRequiresAggregateColumnWriter, findAttributeMapping, forEachAttributeMapping, hasPartitionedSelectionMapping, isAffectedByEnabledFilters
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, asBasicValuedModelPart, breakDownJdbcValues, decompose, decompose, isEntityIdentifierMapping, isVirtual
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
Methods inherited from interface org.hibernate.metamodel.mapping.Restrictable
applyBaseRestrictions
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
determineSqlJoinType
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachNonFormula, forEachUpdatable
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
Constructor Details
-
AnonymousTupleEntityValuedModelPart
public AnonymousTupleEntityValuedModelPart(EntityIdentifierMapping identifierMapping, DomainType<?> domainType, EntityValuedModelPart delegate, int fetchableIndex)
-
-
Method Details
-
getForeignKeyPart
-
findSubPart
- Specified by:
findSubPart
in interfaceEntityValuedModelPart
- Specified by:
findSubPart
in interfaceModelPartContainer
-
visitSubParts
- Specified by:
visitSubParts
in interfaceEntityValuedModelPart
- Specified by:
visitSubParts
in interfaceModelPartContainer
-
getPartMappingType
Description copied from interface:ModelPart
The type for this part.- Specified by:
getPartMappingType
in interfaceEntityMappingType
- Specified by:
getPartMappingType
in interfaceManagedMappingType
- Specified by:
getPartMappingType
in interfaceModelPart
-
getMappedType
Description copied from interface:ValueMapping
Descriptor for the type of this mapping- Specified by:
getMappedType
in interfaceValueMapping
-
getJavaType
Description copied from interface:ModelPart
The Java type for this part. Generally equivalent toMappingType.getMappedJavaType()
relative toModelPart.getPartMappingType()
- Specified by:
getJavaType
in interfaceEntityMappingType
- Specified by:
getJavaType
in interfaceManagedMappingType
- Specified by:
getJavaType
in interfaceModelPart
-
getPartName
Description copied from interface:ModelPart
The local part name, which is generally the unqualified role name- Specified by:
getPartName
in interfaceEntityMappingType
- Specified by:
getPartName
in interfaceModelPart
-
getContainingTableExpression
Description copied from interface:ValuedModelPart
The table which contains the columns mapped by this value- Specified by:
getContainingTableExpression
in interfaceValuedModelPart
-
getJdbcTypeCount
public int getJdbcTypeCount()Description copied from interface:Bindable
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceEntityMappingType
- Specified by:
getJdbcTypeCount
in interfaceEntityValuedModelPart
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
- Specified by:
getJdbcTypeCount
in interfaceSelectableMappings
- Specified by:
getJdbcTypeCount
in interfaceValuedModelPart
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()Description copied from interface:EntityMappingType
The total number of attributes for this entity, including those declared on supertype mappings- Specified by:
getNumberOfAttributeMappings
in interfaceEntityMappingType
- Specified by:
getNumberOfAttributeMappings
in interfaceManagedMappingType
-
getAttributeMapping
Description copied from interface:EntityMappingType
Retrieve an attribute mapping by position, relative to all attributes- Specified by:
getAttributeMapping
in interfaceEntityMappingType
- Specified by:
getAttributeMapping
in interfaceManagedMappingType
-
getAttributeMappings
Description copied from interface:EntityMappingType
The attributes mapping for this entity, including those declared on supertype mappings- Specified by:
getAttributeMappings
in interfaceEntityMappingType
- Specified by:
getAttributeMappings
in interfaceManagedMappingType
-
forEachAttributeMapping
Description copied from interface:EntityMappingType
Visit each attribute mapping- Specified by:
forEachAttributeMapping
in interfaceEntityMappingType
- Specified by:
forEachAttributeMapping
in interfaceManagedMappingType
- See Also:
-
getValues
Description copied from interface:ManagedMappingType
Extract the individual attribute values from the entity instance- Specified by:
getValues
in interfaceManagedMappingType
-
getValue
Description copied from interface:ManagedMappingType
Extract a specific attribute value from the entity instance, by position- Specified by:
getValue
in interfaceManagedMappingType
-
setValues
Description copied from interface:ManagedMappingType
Inject the attribute values into the entity instance- Specified by:
setValues
in interfaceManagedMappingType
-
setValue
Description copied from interface:ManagedMappingType
Inject a specific attribute value into the entity instance, by position- Specified by:
setValue
in interfaceManagedMappingType
-
getJdbcMapping
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
getSingleJdbcMapping
- Specified by:
getSingleJdbcMapping
in interfaceJdbcMappingContainer
- Specified by:
getSingleJdbcMapping
in interfaceValuedModelPart
-
forEachSelectable
Description copied from interface:ModelPart
A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- Specified by:
forEachSelectable
in interfaceValuedModelPart
-
forEachSelectable
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:
-
getSelectable
Description copied from interface:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceSelectableMappings
-
getMappedJavaType
Description copied from interface:MappingType
The descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaType
in interfaceEntityMappingType
- Specified by:
getMappedJavaType
in interfaceMappingType
-
getSqlAliasStem
Description copied from interface:TableGroupProducer
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedNote that this is a metadata-ive value. It is only ever used internal to the producer producing its TableGroup.
- Specified by:
getSqlAliasStem
in interfaceEntityMappingType
- Specified by:
getSqlAliasStem
in interfaceTableGroupProducer
- See Also:
-
getNumberOfFetchables
public int getNumberOfFetchables()Description copied from interface:FetchableContainer
The number of fetchables in the container- Specified by:
getNumberOfFetchables
in interfaceEntityMappingType
- Specified by:
getNumberOfFetchables
in interfaceFetchableContainer
-
findContainingEntityMapping
- Specified by:
findContainingEntityMapping
in interfaceEntityMappingType
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
isExplicitPolymorphism
public boolean isExplicitPolymorphism()Description copied from interface:EntityMappingType
Is this class explicit polymorphism only?- Specified by:
isExplicitPolymorphism
in interfaceEntityMappingType
-
forEachJdbcType
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceEntityValuedModelPart
- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
getEntityPersister
Description copied from interface:EntityMappingType
Safety-net.- Specified by:
getEntityPersister
in interfaceEntityMappingType
-
getEntityName
Description copied from interface:EntityMappingType
The entity name. For most entities, this will be the fully-qualified name of the entity class. The alternative is an explicit entity-name which takes precedence if provided- Specified by:
getEntityName
in interfaceEntityMappingType
-
getMappedTableDetails
Description copied from interface:EntityMappingType
Details for the table this entity maps. Generally this is the same asEntityMappingType.getIdentifierTableDetails()
, though may be different for subtypes in joined andunion inheritance hierarchies- Specified by:
getMappedTableDetails
in interfaceEntityMappingType
- See Also:
-
getIdentifierTableDetails
Description copied from interface:EntityMappingType
Details for the table that defines the identifier column(s) for an entity hierarchy.- Specified by:
getIdentifierTableDetails
in interfaceEntityMappingType
-
visitQuerySpaces
Description copied from interface:EntityMappingType
Visit each "query space" for the mapped entity.- Specified by:
visitQuerySpaces
in interfaceEntityMappingType
-
findDeclaredAttributeMapping
Description copied from interface:EntityMappingType
Find an attribute-mapping, declared on this entity mapping (not super or subs), by name- Specified by:
findDeclaredAttributeMapping
in interfaceEntityMappingType
-
getDeclaredAttributeMappings
Description copied from interface:EntityMappingType
Get access to the attributes defined on this class - do not access attributes defined on the super- Specified by:
getDeclaredAttributeMappings
in interfaceEntityMappingType
-
visitDeclaredAttributeMappings
Description copied from interface:EntityMappingType
Visit attributes defined on this class - do not visit attributes defined on the super- Specified by:
visitDeclaredAttributeMappings
in interfaceEntityMappingType
-
getIdentifierMapping
Description copied from interface:EntityMappingType
Mapping details for the entity's identifier. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getIdentifierMapping
in interfaceEntityMappingType
-
getDiscriminatorMapping
Description copied from interface:EntityMappingType
Mapping details for the entity's discriminator. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getDiscriminatorMapping
in interfaceDiscriminable
- Specified by:
getDiscriminatorMapping
in interfaceEntityMappingType
-
getDiscriminatorValue
Description copied from interface:EntityMappingType
The discriminator value which indicates this entity mapping- Specified by:
getDiscriminatorValue
in interfaceEntityMappingType
-
getDiscriminatorSQLValue
- Specified by:
getDiscriminatorSQLValue
in interfaceEntityMappingType
-
getVersionMapping
Description copied from interface:EntityMappingType
Mapping details for the entity's version when using the version strategy. This is shared across all entity mappings within an inheritance hierarchy.- Specified by:
getVersionMapping
in interfaceEntityMappingType
- Returns:
- The version mapping, or null if the entity is (1) defined
with a strategy other than
OptimisticLockStyle.VERSION
or (2) defined without optimistic locking - See Also:
-
optimisticLockStyle
Description copied from interface:EntityMappingType
The type of optimistic locking, if any, defined for this entity mapping- Specified by:
optimisticLockStyle
in interfaceEntityMappingType
-
getNaturalIdMapping
Description copied from interface:EntityMappingType
The mapping for the natural-id of the entity, if one is defined- Specified by:
getNaturalIdMapping
in interfaceEntityMappingType
-
getRowIdMapping
Description copied from interface:EntityMappingType
The mapping for the row-id of the entity, if one is defined.- Specified by:
getRowIdMapping
in interfaceEntityMappingType
-
getSoftDeleteMapping
Description copied from interface:EntityMappingType
Mapping for soft-delete support, ornull
if soft-delete not defined- Specified by:
getSoftDeleteMapping
in interfaceEntityMappingType
- Specified by:
getSoftDeleteMapping
in interfaceSoftDeletableModelPart
-
getSoftDeleteTableDetails
- Specified by:
getSoftDeleteTableDetails
in interfaceEntityMappingType
- Specified by:
getSoftDeleteTableDetails
in interfaceSoftDeletableModelPart
-
visitConstraintOrderedTables
- Specified by:
visitConstraintOrderedTables
in interfaceEntityMappingType
-
getNaturalIdLoader
Description copied from interface:EntityMappingType
Access to performing natural-id database selection. This is per-entity in the hierarchy- Specified by:
getNaturalIdLoader
in interfaceEntityMappingType
-
getMultiNaturalIdLoader
Description copied from interface:EntityMappingType
Access to performing multi-value natural-id database selection. This is per-entity in the hierarchy- Specified by:
getMultiNaturalIdLoader
in interfaceEntityMappingType
-
getEntityMappingType
Description copied from interface:EntityValuedModelPart
The descriptor of the entity that is the type for this part- Specified by:
getEntityMappingType
in interfaceEntityValuedModelPart
-
getDefaultSqlAstJoinType
- Specified by:
getDefaultSqlAstJoinType
in interfaceTableGroupJoinProducer
-
isSimpleJoinPredicate
Description copied from interface:TableGroupJoinProducer
Returns whether the given predicate is a simple join predicate for this attribute. This is useful to understand if a predicate has additional conjunctions other than the FK related predicate.- Specified by:
isSimpleJoinPredicate
in interfaceTableGroupJoinProducer
-
containsTableReference
- Specified by:
containsTableReference
in interfaceTableGroupProducer
-
getBatchSize
public int getBatchSize()- Specified by:
getBatchSize
in interfaceLoadable
-
isAffectedByInfluencers
- Specified by:
isAffectedByInfluencers
in interfaceLoadable
-
isAffectedByEnabledFilters
public boolean isAffectedByEnabledFilters(LoadQueryInfluencers influencers, boolean onlyApplyForLoadByKeyFilters) Description copied from interface:Loadable
Whether any of the "influencers" affect this loadable.- Specified by:
isAffectedByEnabledFilters
in interfaceEntityMappingType
- Specified by:
isAffectedByEnabledFilters
in interfaceLoadable
-
isNotAffectedByInfluencers
- Specified by:
isNotAffectedByInfluencers
in interfaceLoadable
-