Class EmbeddedCollectionPart
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.EmbeddedCollectionPart
-
- All Implemented Interfaces:
Bindable,CollectionPart,EmbeddableValuedModelPart,JdbcMappingContainer,MappingModelExpressible,ModelPart,ModelPartContainer,SelectableMappings,ValuedModelPart,ValueMapping,TableGroupJoinProducer,TableGroupProducer,EmbeddableValuedFetchable,Fetchable,FetchableContainer,FetchOptions,FetchStyleAccess,FetchTimingAccess,JavaTypedExpressible
public class EmbeddedCollectionPart extends Object implements CollectionPart, EmbeddableValuedFetchable, FetchOptions
-
-
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.CollectionPart
CollectionPart.Nature
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer
-
-
Constructor Summary
Constructors Constructor Description EmbeddedCollectionPart(CollectionPersister collectionDescriptor, CollectionPart.Nature nature, EmbeddableMappingType embeddableMappingType, String parentInjectionAttributeName, String containingTableExpression, String sqlAliasStem)
-
Method Summary
All Methods Instance Methods Concrete 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.booleancontainsTableReference(String tableExpression)<T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for a specific reference to this ModelPart.TableGroupcreateRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType sqlAstJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)Create the "join", but return a TableGroup.TableGroupJoincreateTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)Create a TableGroupJoin.EntityMappingTypefindContainingEntityMapping()ModelPartfindSubPart(String name, EntityMappingType treatTargetType)FetchgenerateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)Generates a Fetch of this fetchableStringgetContainingTableExpression()The table which contains the columns mapped by this valueEmbeddableMappingTypegetEmbeddableTypeDescriptor()JavaType<?>getExpressibleJavaType()intgetFetchableKey()The key that identifies this Fetchable within aFetchableContainer.StringgetFetchableName()The name of the fetchable.FetchOptionsgetMappedFetchOptions()The configured fetch timing and styleCollectionPart.NaturegetNature()NavigableRolegetNavigableRole()PropertyAccessgetParentInjectionAttributePropertyAccess()MappingTypegetPartMappingType()The type for this part.StringgetSqlAliasStem()Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedFetchStylegetStyle()FetchTiminggetTiming()SqlTupletoSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)StringtoString()voidvisitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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.CollectionPart
getInclusionCheckPart, getPartName
-
Methods inherited from interface org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable
getDefaultSqlAstJoinType, isSimpleJoinPredicate
-
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableValuedModelPart
addToCacheKey, breakDownJdbcValues, decompose, disassemble, forEachDisassembledJdbcValue, forEachInsertable, forEachJdbcType, forEachJdbcValue, forEachSelectable, forEachSubPart, forEachUpdatable, getFetchable, getJavaType, getJdbcMapping, getJdbcMappings, getJdbcTypeCount, getMappedType, getNumberOfFetchables, getSelectable, getSelectableIndex, hasPartitionedSelectionMapping
-
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.type.descriptor.java.JavaTypedExpressible
addToCacheKey
-
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.metamodel.mapping.ValuedModelPart
forEachNonFormula, forEachSelectable, getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
treatAs
-
-
-
-
Constructor Detail
-
EmbeddedCollectionPart
public EmbeddedCollectionPart(CollectionPersister collectionDescriptor, CollectionPart.Nature nature, EmbeddableMappingType embeddableMappingType, String parentInjectionAttributeName, String containingTableExpression, String sqlAliasStem)
-
-
Method Detail
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPartCreate a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResultin interfaceModelPart
-
getNature
public CollectionPart.Nature getNature()
- Specified by:
getNaturein interfaceCollectionPart
-
getEmbeddableTypeDescriptor
public EmbeddableMappingType getEmbeddableTypeDescriptor()
- Specified by:
getEmbeddableTypeDescriptorin interfaceEmbeddableValuedModelPart
-
getPartMappingType
public MappingType getPartMappingType()
Description copied from interface:ModelPartThe type for this part.- Specified by:
getPartMappingTypein interfaceModelPart
-
getContainingTableExpression
public String getContainingTableExpression()
Description copied from interface:ValuedModelPartThe table which contains the columns mapped by this value- Specified by:
getContainingTableExpressionin interfaceValuedModelPart
-
getParentInjectionAttributePropertyAccess
public PropertyAccess getParentInjectionAttributePropertyAccess()
- Specified by:
getParentInjectionAttributePropertyAccessin interfaceEmbeddableValuedModelPart- See Also:
Parent
-
getFetchableName
public String getFetchableName()
Description copied from interface:FetchableThe name of the fetchable. This is the part's "local name".- Specified by:
getFetchableNamein interfaceFetchable- See Also:
ModelPart.getNavigableRole(),NavigableRole.getLocalName()
-
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
public FetchOptions getMappedFetchOptions()
Description copied from interface:FetchableThe configured fetch timing and style- Specified by:
getMappedFetchOptionsin interfaceFetchable
-
generateFetch
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:FetchableGenerates a Fetch of this fetchable- Specified by:
generateFetchin interfaceFetchable- Parameters:
fetchParent- The parent of the Fetch we are generatingfetchablePath- The overall path within the graphfetchTiming- The requested fetch timing
-
toSqlExpression
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
- Specified by:
toSqlExpressionin interfaceEmbeddableValuedModelPart
-
createTableGroupJoin
public TableGroupJoin createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)
Description copied from interface:TableGroupJoinProducerCreate a TableGroupJoin.- Specified by:
createTableGroupJoinin interfaceTableGroupJoinProducer- Parameters:
navigablePath- The NavigablePath to the joinlhs- The join's (L)eft-(H)and (S)ideexplicitSqlAliasBase- A specific SqlAliasBase to use. May benullindicating one should be created using the SqlAliasBaseGenerator fromcreationStaterequestedJoinType- An explicit join-type. May be null to signal that the join is for an implicit path.addsPredicate- Indicates there are explicit, additional predicates (from an SQM tree ON/WITH clause)
-
createRootTableGroupJoin
public TableGroup createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType sqlAstJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)
Description copied from interface:TableGroupJoinProducerCreate the "join", but return a TableGroup. Intended for creating sub-query correlations. E.g., givenfrom SomeEntity e where exists ( select 1 from AnotherEntity a where e.association.attr = 1 )We call this for the `e.association` path.- Specified by:
createRootTableGroupJoinin interfaceTableGroupJoinProducer- Parameters:
navigablePath- The NavigablePath to the joinlhs- The join's (L)eft-(H)and (S)ideexplicitSqlAliasBase- A specific SqlAliasBase to use. May benullindicating one should be created using the SqlAliasBaseGenerator fromcreationStatesqlAstJoinType- An explicit join-type. May be null to signal that the join is for an implicit path.predicateConsumer- Consumer for additional predicates from the producer's mapping.
-
getSqlAliasStem
public String 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:
SqlAliasBaseManager.createSqlAliasBase(java.lang.String)
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPartin interfaceEmbeddableValuedModelPart- Specified by:
findSubPartin interfaceModelPartContainer
-
visitSubParts
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
- Specified by:
visitSubPartsin interfaceEmbeddableValuedModelPart- Specified by:
visitSubPartsin interfaceModelPartContainer
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
getExpressibleJavaType
public JavaType<?> getExpressibleJavaType()
- Specified by:
getExpressibleJavaTypein interfaceJavaTypedExpressible- Specified by:
getExpressibleJavaTypein interfaceValueMapping
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRolein interfaceModelPart- See Also:
ModelPart.getPartName()
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
getStyle
public FetchStyle getStyle()
- Specified by:
getStylein interfaceFetchStyleAccess
-
getTiming
public FetchTiming getTiming()
- Specified by:
getTimingin interfaceFetchTimingAccess
-
containsTableReference
public boolean containsTableReference(String tableExpression)
- Specified by:
containsTableReferencein interfaceTableGroupProducer
-
-