Package org.hibernate.query.derived
Class AnonymousTupleEmbeddableValuedModelPart
java.lang.Object
org.hibernate.query.derived.AnonymousTupleEmbeddableValuedModelPart
- All Implemented Interfaces:
Bindable
,EmbeddableMappingType
,EmbeddableValuedModelPart
,JdbcMappingContainer
,ManagedMappingType
,MappingModelExpressible
,MappingType
,ModelPart
,ModelPartContainer
,SelectableMappings
,ValuedModelPart
,ValueMapping
,TableGroupJoinProducer
,TableGroupProducer
,Fetchable
,FetchableContainer
,JavaTypedExpressible
- Direct Known Subclasses:
AnonymousTupleEmbeddedEntityIdentifierMapping
,AnonymousTupleNonAggregatedEntityIdentifierMapping
@Incubating
public class AnonymousTupleEmbeddableValuedModelPart
extends Object
implements EmbeddableValuedModelPart, EmbeddableMappingType
-
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.EmbeddableMappingType
EmbeddableMappingType.ConcreteEmbeddableType
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,
Y>, ModelPart.JdbcValueConsumer -
Constructor Summary
ConstructorDescriptionAnonymousTupleEmbeddableValuedModelPart
(SqmExpressible<?> sqmExpressible, List<SqlSelection> sqlSelections, int selectionIndex, String selectionExpression, Set<String> compatibleTableExpressions, Set<Attribute<?, ?>> attributes, DomainType<?> domainType, String componentName, EmbeddableValuedModelPart existingModelPartContainer, 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.<T> DomainResult<T>
createDomainResult
(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState) Create a DomainResult for a specific reference to this ModelPart.createInverseMappingType
(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess) createRootTableGroupJoin
(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType sqlAstJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState) Create the "join", but return a TableGroup.createTableGroupJoin
(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState) Create a TableGroupJoin.<X,
Y> int decompose
(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session) Similar toModelPart.breakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)
, but this method is supposed to be used for decomposing values for assignment expressions.disassemble
(Object value, SharedSessionContractImplementor session) Breaks down a value ofJ
into its simple pieces.findSubPart
(String name, EntityMappingType treatTargetType) void
forEachAttributeMapping
(Consumer<? super AttributeMapping> action) Visit attributes defined on this class and any supers<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)
.void
forEachInsertable
(int offset, SelectableConsumer consumer) 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.void
forEachSubPart
(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget) void
forEachUpdatable
(int offset, SelectableConsumer consumer) generateFetch
(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState) Generates a Fetch of this fetchablegetAttributeMapping
(int position) Retrieve an attribute by its contributor positionGet access to the attributes defined on this class and any supersThe table which contains the columns mapped by this valuegetDefaultSqlAstJoinType
(TableGroup parentTableGroup) getFetchable
(int position) int
The key that identifies this Fetchable within aFetchableContainer
.The name of the fetchable.JavaType<?>
The Java type for this part.getJdbcMapping
(int index) int
The number of JDBC mappingsThe configured fetch timing and styleJavaType<?>
The descriptor descriptor for the mapped Java typeint
Get the number of attributes defined on this class and any supersint
The number of fetchables in the containerThe local part name, which is generally the unqualified role namegetSelectable
(int columnIndex) Get the selectable at the given positionint
getSelectableIndex
(String selectableName) Get 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 instanceboolean
boolean
boolean
isSimpleJoinPredicate
(Predicate predicate) Returns whether the given predicate is a simple join predicate for this attribute.void
Inject a specific attribute value into the entity instance, by positionvoid
Inject the attribute values into the entity instancetoSqlExpression
(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState) 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.EmbeddableMappingType
anyRequiresAggregateColumnWriter, compare, findSubtypeByDiscriminator, findSubtypeBySubclass, getAggregateMapping, getConcreteEmbeddableTypes, getDiscriminatorMapping, getJdbcValueCount, getJdbcValueSelectable, getPartMappingType, isPolymorphic, requiresAggregateColumnWriter, shouldBindAggregateMapping, shouldMutateAggregateMapping, shouldSelectAggregateMapping
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableValuedModelPart
forEachInsertable, forEachUpdatable, getMappedType, getParentInjectionAttributePropertyAccess
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, incrementFetchDepth, isSelectable, resolveCircularFetch
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
findAttributeMapping, forEachAttributeMapping, isAffectedByEnabledFilters
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, isEntityIdentifierMapping, isVirtual
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
determineSqlJoinType
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachNonFormula, getSingleJdbcMapping
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
Constructor Details
-
AnonymousTupleEmbeddableValuedModelPart
public AnonymousTupleEmbeddableValuedModelPart(SqmExpressible<?> sqmExpressible, List<SqlSelection> sqlSelections, int selectionIndex, String selectionExpression, Set<String> compatibleTableExpressions, Set<Attribute<?, ?>> attributes, DomainType<?> domainType, String componentName, EmbeddableValuedModelPart existingModelPartContainer, int fetchableIndex)
-
-
Method Details
-
findSubPart
- Specified by:
findSubPart
in interfaceEmbeddableValuedModelPart
- Specified by:
findSubPart
in interfaceModelPartContainer
-
forEachSubPart
- Specified by:
forEachSubPart
in interfaceEmbeddableValuedModelPart
- Specified by:
forEachSubPart
in interfaceModelPartContainer
-
visitSubParts
- Specified by:
visitSubParts
in interfaceEmbeddableValuedModelPart
- Specified by:
visitSubParts
in interfaceModelPartContainer
-
getJavaType
Description copied from interface:ModelPart
The Java type for this part. Generally equivalent toMappingType.getMappedJavaType()
relative toModelPart.getPartMappingType()
- Specified by:
getJavaType
in interfaceEmbeddableValuedModelPart
- 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 interfaceModelPart
-
getJdbcTypeCount
public int getJdbcTypeCount()Description copied from interface:Bindable
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceEmbeddableMappingType
- Specified by:
getJdbcTypeCount
in interfaceEmbeddableValuedModelPart
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
- Specified by:
getJdbcTypeCount
in interfaceSelectableMappings
- Specified by:
getJdbcTypeCount
in interfaceValuedModelPart
-
getEmbeddableTypeDescriptor
- Specified by:
getEmbeddableTypeDescriptor
in interfaceEmbeddableValuedModelPart
-
getEmbeddedValueMapping
- Specified by:
getEmbeddedValueMapping
in interfaceEmbeddableMappingType
-
getRepresentationStrategy
- Specified by:
getRepresentationStrategy
in interfaceEmbeddableMappingType
-
isCreateEmptyCompositesEnabled
public boolean isCreateEmptyCompositesEnabled()- Specified by:
isCreateEmptyCompositesEnabled
in interfaceEmbeddableMappingType
-
createInverseMappingType
public EmbeddableMappingType createInverseMappingType(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess) - Specified by:
createInverseMappingType
in interfaceEmbeddableMappingType
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()Description copied from interface:ManagedMappingType
Get the number of attributes defined on this class and any supers- Specified by:
getNumberOfAttributeMappings
in interfaceManagedMappingType
-
getAttributeMapping
Description copied from interface:ManagedMappingType
Retrieve an attribute by its contributor position- Specified by:
getAttributeMapping
in interfaceManagedMappingType
-
getAttributeMappings
Description copied from interface:ManagedMappingType
Get access to the attributes defined on this class and any supers- Specified by:
getAttributeMappings
in interfaceManagedMappingType
-
forEachAttributeMapping
Description copied from interface:ManagedMappingType
Visit attributes defined on this class and any supers- Specified by:
forEachAttributeMapping
in interfaceManagedMappingType
-
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
-
getSelectableIndex
- Specified by:
getSelectableIndex
in interfaceEmbeddableMappingType
- Specified by:
getSelectableIndex
in interfaceEmbeddableValuedModelPart
- Specified by:
getSelectableIndex
in interfaceFetchableContainer
-
getSelectable
Description copied from interface:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceEmbeddableValuedModelPart
- Specified by:
getSelectable
in interfaceSelectableMappings
-
getFetchable
- Specified by:
getFetchable
in interfaceEmbeddableValuedModelPart
- Specified by:
getFetchable
in interfaceFetchableContainer
-
getJdbcMapping
- Specified by:
getJdbcMapping
in interfaceEmbeddableValuedModelPart
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
forEachSelectable
Description copied from interface:ModelPart
A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer)
, that passes 0 as offset.- Specified by:
forEachSelectable
in interfaceEmbeddableMappingType
- 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 interfaceEmbeddableMappingType
- Specified by:
forEachSelectable
in interfaceEmbeddableValuedModelPart
- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- Specified by:
forEachSelectable
in interfaceValuedModelPart
- See Also:
-
forEachInsertable
- Specified by:
forEachInsertable
in interfaceEmbeddableMappingType
-
forEachUpdatable
- Specified by:
forEachUpdatable
in interfaceEmbeddableMappingType
-
getContainingTableExpression
Description copied from interface:ValuedModelPart
The table which contains the columns mapped by this value- Specified by:
getContainingTableExpression
in interfaceValuedModelPart
-
toSqlExpression
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState) - Specified by:
toSqlExpression
in interfaceEmbeddableValuedModelPart
-
getMappedJavaType
Description copied from interface:MappingType
The descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaType
in interfaceMappingType
-
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
-
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 interfaceTableGroupProducer
- See Also:
-
getFetchableName
Description copied from interface:Fetchable
The name of the fetchable. This is the part's "local name".- Specified by:
getFetchableName
in interfaceFetchable
- See Also:
-
getFetchableKey
public int getFetchableKey()Description copied from interface:Fetchable
The key that identifies this Fetchable within aFetchableContainer
. If this Fetchable is part ofFetchableContainer.visitFetchables(IndexedConsumer, EntityMappingType)
, the values is guaranteed to be between 0 (inclusive) andFetchableContainer.getNumberOfFetchableKeys()
(exclusive). Other Fetchable objects may have a special negative value.The main intent of this key is to index e.g.
Fetch
objects in an array.- Specified by:
getFetchableKey
in interfaceFetchable
-
getMappedFetchOptions
Description copied from interface:Fetchable
The configured fetch timing and style- Specified by:
getMappedFetchOptions
in interfaceFetchable
-
getNumberOfFetchables
public int getNumberOfFetchables()Description copied from interface:FetchableContainer
The number of fetchables in the container- Specified by:
getNumberOfFetchables
in interfaceEmbeddableValuedModelPart
- Specified by:
getNumberOfFetchables
in interfaceFetchableContainer
-
findContainingEntityMapping
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()- Specified by:
hasPartitionedSelectionMapping
in interfaceEmbeddableValuedModelPart
- Specified by:
hasPartitionedSelectionMapping
in interfaceManagedMappingType
- Specified by:
hasPartitionedSelectionMapping
in interfaceModelPart
-
forEachJdbcType
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceEmbeddableMappingType
- Specified by:
forEachJdbcType
in interfaceEmbeddableValuedModelPart
- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-