Class AnonymousTupleEmbeddableValuedModelPart
java.lang.Object
org.hibernate.query.sqm.tuple.internal.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.ConcreteEmbeddableTypeNested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer -
Constructor Summary
ConstructorsConstructorDescriptionAnonymousTupleEmbeddableValuedModelPart(SqmExpressible<?> sqmExpressible, SqlTypedMapping[] sqlTypedMappings, int selectionIndex, String selectionExpression, Set<String> compatibleTableExpressions, Set<? extends Attribute<?, ?>> attributes, DomainType<?> domainType, String componentName, EmbeddableValuedModelPart existingModelPartContainer, int fetchableIndex) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session) Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.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.<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, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType sqlAstJoinType, boolean fetched, @Nullable Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState) Create the "join", but return a TableGroup.createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable 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 ofJinto its simple pieces.findSubPart(String name, EntityMappingType treatTargetType) voidforEachAttributeMapping(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).voidforEachInsertable(int offset, SelectableConsumer consumer) intforEachJdbcType(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.intforEachSelectable(int offset, SelectableConsumer consumer) Visits each selectable mapping with the selectable index offset by the given value.intforEachSelectable(SelectableConsumer consumer) A short hand form ofModelPart.forEachSelectable(int, SelectableConsumer), that passes 0 as offset.voidforEachSubPart(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget) voidforEachUpdatable(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) intThe key that identifies this Fetchable within aFetchableContainer.The name of the fetchable.JavaType<?> The Java type for this part.getJdbcMapping(int index) intThe number of JDBC mappingsThe configured fetch timing and styleJavaType<?> The descriptor descriptor for the mapped Java typeintGet the number of attributes defined on this class and any supersintThe number of fetchables in the containerThe local part name, which is generally the unqualified role namegetSelectable(int columnIndex) Get the selectable at the given positionintgetSelectableIndex(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 instancebooleanbooleanisSimpleJoinPredicate(Predicate predicate) Returns whether the given predicate is a simple join predicate for this attribute.voidInject a specific attribute value into the entity instance, by positionvoidInject the attribute values into the entity instancetoSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState) voidvisitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValueMethods inherited from interface org.hibernate.metamodel.mapping.EmbeddableMappingType
anyRequiresAggregateColumnWriter, compare, findSubtypeByDiscriminator, findSubtypeBySubclass, getAggregateMapping, getConcreteEmbeddableTypes, getDiscriminatorMapping, getJdbcValueCount, getJdbcValueSelectable, getPartMappingType, isPolymorphic, requiresAggregateColumnWriter, shouldBindAggregateMapping, shouldMutateAggregateMapping, shouldSelectAggregateMappingMethods inherited from interface org.hibernate.metamodel.mapping.EmbeddableValuedModelPart
forEachInsertable, forEachUpdatable, getMappedType, getParentInjectionAttributePropertyAccessMethods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, incrementFetchDepth, isSelectable, resolveCircularFetchMethods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchablesMethods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
findAttributeMapping, forEachAttributeMapping, isAffectedByEnabledFiltersMethods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, isEntityIdentifierMapping, isVirtualMethods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPartMethods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
determineSqlJoinTypeMethods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReferenceMethods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachNonFormula, getSingleJdbcMappingMethods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
Constructor Details
-
AnonymousTupleEmbeddableValuedModelPart
public AnonymousTupleEmbeddableValuedModelPart(SqmExpressible<?> sqmExpressible, SqlTypedMapping[] sqlTypedMappings, int selectionIndex, String selectionExpression, Set<String> compatibleTableExpressions, Set<? extends Attribute<?, ?>> attributes, DomainType<?> domainType, String componentName, EmbeddableValuedModelPart existingModelPartContainer, int fetchableIndex)
-
-
Method Details
-
findSubPart
- Specified by:
findSubPartin interfaceEmbeddableValuedModelPart- Specified by:
findSubPartin interfaceModelPartContainer
-
forEachSubPart
- Specified by:
forEachSubPartin interfaceEmbeddableValuedModelPart- Specified by:
forEachSubPartin interfaceModelPartContainer
-
visitSubParts
- Specified by:
visitSubPartsin interfaceEmbeddableValuedModelPart- Specified by:
visitSubPartsin interfaceModelPartContainer
-
getJavaType
Description copied from interface:ModelPartThe Java type for this part. Generally equivalent toMappingType.getMappedJavaType()relative toModelPart.getPartMappingType()- Specified by:
getJavaTypein interfaceEmbeddableValuedModelPart- Specified by:
getJavaTypein interfaceManagedMappingType- Specified by:
getJavaTypein interfaceModelPart
-
getPartName
Description copied from interface:ModelPartThe local part name, which is generally the unqualified role name- Specified by:
getPartNamein interfaceModelPart
-
getJdbcTypeCount
public int getJdbcTypeCount()Description copied from interface:BindableThe number of JDBC mappings- Specified by:
getJdbcTypeCountin interfaceBindable- Specified by:
getJdbcTypeCountin interfaceEmbeddableMappingType- Specified by:
getJdbcTypeCountin interfaceEmbeddableValuedModelPart- Specified by:
getJdbcTypeCountin interfaceJdbcMappingContainer- Specified by:
getJdbcTypeCountin interfaceSelectableMappings- Specified by:
getJdbcTypeCountin interfaceValuedModelPart
-
getEmbeddableTypeDescriptor
- Specified by:
getEmbeddableTypeDescriptorin interfaceEmbeddableValuedModelPart
-
getEmbeddedValueMapping
- Specified by:
getEmbeddedValueMappingin interfaceEmbeddableMappingType
-
getRepresentationStrategy
- Specified by:
getRepresentationStrategyin interfaceEmbeddableMappingType
-
createInverseMappingType
public EmbeddableMappingType createInverseMappingType(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess) - Specified by:
createInverseMappingTypein interfaceEmbeddableMappingType
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()Description copied from interface:ManagedMappingTypeGet the number of attributes defined on this class and any supers- Specified by:
getNumberOfAttributeMappingsin interfaceManagedMappingType
-
getAttributeMapping
Description copied from interface:ManagedMappingTypeRetrieve an attribute by its contributor position- Specified by:
getAttributeMappingin interfaceManagedMappingType
-
getAttributeMappings
Description copied from interface:ManagedMappingTypeGet access to the attributes defined on this class and any supers- Specified by:
getAttributeMappingsin interfaceManagedMappingType
-
forEachAttributeMapping
Description copied from interface:ManagedMappingTypeVisit attributes defined on this class and any supers- Specified by:
forEachAttributeMappingin interfaceManagedMappingType
-
getValues
Description copied from interface:ManagedMappingTypeExtract the individual attribute values from the entity instance- Specified by:
getValuesin interfaceManagedMappingType
-
getValue
Description copied from interface:ManagedMappingTypeExtract a specific attribute value from the entity instance, by position- Specified by:
getValuein interfaceManagedMappingType
-
setValues
Description copied from interface:ManagedMappingTypeInject the attribute values into the entity instance- Specified by:
setValuesin interfaceManagedMappingType
-
setValue
Description copied from interface:ManagedMappingTypeInject a specific attribute value into the entity instance, by position- Specified by:
setValuein interfaceManagedMappingType
-
getSelectableIndex
- Specified by:
getSelectableIndexin interfaceEmbeddableMappingType- Specified by:
getSelectableIndexin interfaceEmbeddableValuedModelPart- Specified by:
getSelectableIndexin interfaceFetchableContainer
-
getSelectable
Description copied from interface:SelectableMappingsGet the selectable at the given position- Specified by:
getSelectablein interfaceEmbeddableValuedModelPart- Specified by:
getSelectablein interfaceSelectableMappings
-
getFetchable
- Specified by:
getFetchablein interfaceEmbeddableValuedModelPart- Specified by:
getFetchablein interfaceFetchableContainer
-
getJdbcMapping
- Specified by:
getJdbcMappingin interfaceEmbeddableValuedModelPart- Specified by:
getJdbcMappingin interfaceJdbcMappingContainer
-
forEachSelectable
Description copied from interface:ModelPartA short hand form ofModelPart.forEachSelectable(int, SelectableConsumer), that passes 0 as offset.- Specified by:
forEachSelectablein interfaceEmbeddableMappingType- Specified by:
forEachSelectablein interfaceModelPart- Specified by:
forEachSelectablein interfaceSelectableMappings- Specified by:
forEachSelectablein interfaceValuedModelPart
-
forEachSelectable
Description copied from interface:ModelPartVisits each selectable mapping with the selectable index offset by the given value. Returns the amount of jdbc types that have been visited.- Specified by:
forEachSelectablein interfaceEmbeddableMappingType- Specified by:
forEachSelectablein interfaceEmbeddableValuedModelPart- Specified by:
forEachSelectablein interfaceModelPart- Specified by:
forEachSelectablein interfaceSelectableMappings- Specified by:
forEachSelectablein interfaceValuedModelPart- See Also:
-
forEachInsertable
- Specified by:
forEachInsertablein interfaceEmbeddableMappingType
-
forEachUpdatable
- Specified by:
forEachUpdatablein interfaceEmbeddableMappingType
-
getContainingTableExpression
Description copied from interface:ValuedModelPartThe table which contains the columns mapped by this value- Specified by:
getContainingTableExpressionin interfaceValuedModelPart
-
toSqlExpression
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState) - Specified by:
toSqlExpressionin interfaceEmbeddableValuedModelPart
-
getMappedJavaType
Description copied from interface:MappingTypeThe descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaTypein interfaceMappingType
-
getDefaultSqlAstJoinType
- Specified by:
getDefaultSqlAstJoinTypein interfaceTableGroupJoinProducer
-
isSimpleJoinPredicate
Description copied from interface:TableGroupJoinProducerReturns 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:
isSimpleJoinPredicatein interfaceTableGroupJoinProducer
-
getSqlAliasStem
Description copied from interface:TableGroupProducerGet 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:
getSqlAliasStemin interfaceTableGroupProducer- See Also:
-
getFetchableName
Description copied from interface:FetchableThe name of the fetchable. This is the part's "local name".- Specified by:
getFetchableNamein interfaceFetchable- See Also:
-
getFetchableKey
public int getFetchableKey()Description copied from interface:FetchableThe 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.
Fetchobjects in an array.- Specified by:
getFetchableKeyin interfaceFetchable
-
getMappedFetchOptions
Description copied from interface:FetchableThe configured fetch timing and style- Specified by:
getMappedFetchOptionsin interfaceFetchable
-
getNumberOfFetchables
public int getNumberOfFetchables()Description copied from interface:FetchableContainerThe number of fetchables in the container- Specified by:
getNumberOfFetchablesin interfaceEmbeddableValuedModelPart- Specified by:
getNumberOfFetchablesin interfaceFetchableContainer
-
findContainingEntityMapping
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()- Specified by:
hasPartitionedSelectionMappingin interfaceEmbeddableValuedModelPart- Specified by:
hasPartitionedSelectionMappingin interfaceManagedMappingType- Specified by:
hasPartitionedSelectionMappingin interfaceModelPart
-
forEachJdbcType
Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceEmbeddableMappingType- Specified by:
forEachJdbcTypein interfaceEmbeddableValuedModelPart- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-