Package org.hibernate.query.derived
Class AnonymousTupleTableGroupProducer
java.lang.Object
org.hibernate.query.derived.AnonymousTupleTableGroupProducer
- All Implemented Interfaces:
Bindable
,JdbcMappingContainer
,MappingModelExpressible
,MappingType
,ModelPart
,ModelPartContainer
,TableGroupProducer
- Direct Known Subclasses:
CteTupleTableGroupProducer
@Incubating
public class AnonymousTupleTableGroupProducer
extends Object
implements TableGroupProducer, MappingType
The table group producer for an anonymous tuple type.
Model part names are determined based on the tuple type component names.
The kind and type of the model parts is based on the type of the underlying selection.
-
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.ModelPart
ModelPart.JdbcValueBiConsumer<X,
Y>, ModelPart.JdbcValueConsumer -
Constructor Summary
ConstructorDescriptionAnonymousTupleTableGroupProducer
(AnonymousTupleType<?> tupleType, String aliasStem, List<SqlSelection> sqlSelections, FromClauseAccess fromClauseAccess) -
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.static ModelPart
createModelPart
(MappingType mappingType, SqmExpressible<?> sqmExpressible, DomainType<?> domainType, List<SqlSelection> sqlSelections, int selectionIndex, String selectionExpression, String partName, ModelPart existingModelPart, Set<String> compatibleTableExpressions, int fetchableIndex) disassemble
(Object value, SharedSessionContractImplementor session) Breaks down a value ofJ
into its simple pieces.findSubPart
(String name, EntityMappingType treatTargetType) <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 offsetint
forEachSelectable
(int offset, SelectableConsumer consumer) Visits each selectable mapping with the selectable index offset by the given value.void
forEachSubPart
(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget) JavaType<?>
The Java type for this part.getJdbcMapping
(int index) JavaType<?>
The descriptor descriptor for the mapped Java typeThe type for this part.The local part name, which is generally the unqualified role nameGet the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedboolean
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, forEachJdbcValue, getJdbcTypeCount
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getSingleJdbcMapping
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, decompose, forEachSelectable, isEntityIdentifierMapping, isVirtual
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference
-
Constructor Details
-
AnonymousTupleTableGroupProducer
public AnonymousTupleTableGroupProducer(AnonymousTupleType<?> tupleType, String aliasStem, List<SqlSelection> sqlSelections, FromClauseAccess fromClauseAccess)
-
-
Method Details
-
createModelPart
public static ModelPart createModelPart(MappingType mappingType, SqmExpressible<?> sqmExpressible, DomainType<?> domainType, List<SqlSelection> sqlSelections, int selectionIndex, String selectionExpression, String partName, ModelPart existingModelPart, Set<String> compatibleTableExpressions, int fetchableIndex) -
getCompatibleTableExpressions
-
getPartMappingType
Description copied from interface:ModelPart
The type for this part.- Specified by:
getPartMappingType
in interfaceModelPart
-
getMappedJavaType
Description copied from interface:MappingType
The descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaType
in interfaceMappingType
-
getPartName
Description copied from interface:ModelPart
The local part name, which is generally the unqualified role name- Specified by:
getPartName
in interfaceModelPart
-
findContainingEntityMapping
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
findSubPart
- Specified by:
findSubPart
in interfaceModelPartContainer
-
forEachSubPart
- Specified by:
forEachSubPart
in interfaceModelPartContainer
-
visitSubParts
- Specified by:
visitSubParts
in interfaceModelPartContainer
-
getModelParts
-
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:
-
getJavaType
Description copied from interface:ModelPart
The Java type for this part. Generally equivalent toMappingType.getMappedJavaType()
relative toModelPart.getPartMappingType()
- Specified by:
getJavaType
in interfaceModelPart
-
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
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()- Specified by:
hasPartitionedSelectionMapping
in interfaceModelPart
-
getJdbcMapping
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
forEachJdbcType
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-