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 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.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.TableGroup
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.TableGroupJoin
createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)
Create a TableGroupJoin.EntityMappingType
findContainingEntityMapping()
ModelPart
findSubPart(String name, EntityMappingType treatTargetType)
Fetch
generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Generates a Fetch of this fetchablePluralAttributeMapping
getCollectionAttribute()
String
getContainingTableExpression()
The table which contains the columns mapped by this valueEmbeddableMappingType
getEmbeddableTypeDescriptor()
JavaType<?>
getExpressibleJavaType()
int
getFetchableKey()
The key that identifies this Fetchable within aFetchableContainer
.String
getFetchableName()
The name of the fetchable.FetchOptions
getMappedFetchOptions()
The configured fetch timing and styleCollectionPart.Nature
getNature()
NavigableRole
getNavigableRole()
PropertyAccess
getParentInjectionAttributePropertyAccess()
MappingType
getPartMappingType()
The type for this part.String
getSqlAliasStem()
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedFetchStyle
getStyle()
FetchTiming
getTiming()
SqlTuple
toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
String
toString()
void
visitSubParts(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, 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
-
getCollectionAttribute
public PluralAttributeMapping getCollectionAttribute()
- Specified by:
getCollectionAttribute
in interfaceCollectionPart
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Create a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResult
in interfaceModelPart
-
getNature
public CollectionPart.Nature getNature()
- Specified by:
getNature
in interfaceCollectionPart
-
getEmbeddableTypeDescriptor
public EmbeddableMappingType getEmbeddableTypeDescriptor()
- Specified by:
getEmbeddableTypeDescriptor
in interfaceEmbeddableValuedModelPart
-
getPartMappingType
public MappingType getPartMappingType()
Description copied from interface:ModelPart
The type for this part.- Specified by:
getPartMappingType
in interfaceModelPart
-
getContainingTableExpression
public String getContainingTableExpression()
Description copied from interface:ValuedModelPart
The table which contains the columns mapped by this value- Specified by:
getContainingTableExpression
in interfaceValuedModelPart
-
getParentInjectionAttributePropertyAccess
public PropertyAccess getParentInjectionAttributePropertyAccess()
- Specified by:
getParentInjectionAttributePropertyAccess
in interfaceEmbeddableValuedModelPart
- See Also:
Parent
-
getFetchableName
public String 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:
ModelPart.getNavigableRole()
,NavigableRole.getLocalName()
-
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
public FetchOptions getMappedFetchOptions()
Description copied from interface:Fetchable
The configured fetch timing and style- Specified by:
getMappedFetchOptions
in interfaceFetchable
-
generateFetch
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:Fetchable
Generates a Fetch of this fetchable- Specified by:
generateFetch
in 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:
toSqlExpression
in interfaceEmbeddableValuedModelPart
-
createTableGroupJoin
public TableGroupJoin createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)
Description copied from interface:TableGroupJoinProducer
Create a TableGroupJoin.- Specified by:
createTableGroupJoin
in interfaceTableGroupJoinProducer
- Parameters:
navigablePath
- The NavigablePath to the joinlhs
- The join's (L)eft-(H)and (S)ideexplicitSqlAliasBase
- A specific SqlAliasBase to use. May benull
indicating one should be created using the SqlAliasBaseGenerator fromcreationState
requestedJoinType
- 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, @Nullable String explicitSourceAlias, @Nullable SqlAliasBase explicitSqlAliasBase, @Nullable SqlAstJoinType sqlAstJoinType, boolean fetched, @Nullable Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)
Description copied from interface:TableGroupJoinProducer
Create 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:
createRootTableGroupJoin
in interfaceTableGroupJoinProducer
- Parameters:
navigablePath
- The NavigablePath to the joinlhs
- The join's (L)eft-(H)and (S)ideexplicitSqlAliasBase
- A specific SqlAliasBase to use. May benull
indicating one should be created using the SqlAliasBaseGenerator fromcreationState
sqlAstJoinType
- 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: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:
SqlAliasBaseManager.createSqlAliasBase(java.lang.String)
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPart
in interfaceEmbeddableValuedModelPart
- Specified by:
findSubPart
in interfaceModelPartContainer
-
visitSubParts
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
- Specified by:
visitSubParts
in interfaceEmbeddableValuedModelPart
- Specified by:
visitSubParts
in interfaceModelPartContainer
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceModelPart
-
getExpressibleJavaType
public JavaType<?> getExpressibleJavaType()
- Specified by:
getExpressibleJavaType
in interfaceJavaTypedExpressible
- Specified by:
getExpressibleJavaType
in interfaceValueMapping
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRole
in interfaceModelPart
- See Also:
ModelPart.getPartName()
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
getStyle
public FetchStyle getStyle()
- Specified by:
getStyle
in interfaceFetchStyleAccess
-
getTiming
public FetchTiming getTiming()
- Specified by:
getTiming
in interfaceFetchTimingAccess
-
containsTableReference
public boolean containsTableReference(String tableExpression)
- Specified by:
containsTableReference
in interfaceTableGroupProducer
-
-