Class AbstractEntityCollectionPart
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractEntityCollectionPart
-
- All Implemented Interfaces:
Bindable,CollectionPart,EntityValuedModelPart,EntityCollectionPart,JdbcMappingContainer,MappingModelExpressible,ModelPart,ModelPartContainer,SelectableMappings,ValuedModelPart,ValueMapping,TableGroupProducer,EntityValuedFetchable,Fetchable,FetchableContainer,FetchOptions,FetchStyleAccess,FetchTimingAccess,JavaTypedExpressible
- Direct Known Subclasses:
ManyToManyCollectionPart,OneToManyCollectionPart
public abstract class AbstractEntityCollectionPart extends Object implements EntityCollectionPart, FetchOptions, TableGroupProducer
Base support for EntityCollectionPart implementations
-
-
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.internal.EntityCollectionPart
EntityCollectionPart.Cardinality
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>targetKeyPropertyNames
-
Constructor Summary
Constructors Modifier Constructor Description AbstractEntityCollectionPart(CollectionPart.Nature nature, Collection collectionBootDescriptor, CollectionPersister collectionDescriptor, EntityMappingType associatedEntityTypeDescriptor, NotFoundAction notFoundAction, MappingModelCreationProcess creationProcess)protectedAbstractEntityCollectionPart(AbstractEntityCollectionPart original)For Hibernate Reactive
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected EagerCollectionFetchbuildEagerCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, TableGroup collectionTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)For Hibernate Reactiveprotected EntityFetchbuildEntityFetchJoined(FetchParent fetchParent, AbstractEntityCollectionPart abstractEntityCollectionPart, TableGroup partTableGroup, NavigablePath fetchablePath, DomainResultCreationState creationState)For Hibernate ReactivebooleancontainsTableReference(String tableExpression)<T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for a specific reference to this ModelPart.TableGroupcreateTableGroupInternal(boolean canUseInnerJoins, NavigablePath navigablePath, boolean fetched, String sourceAlias, SqlAliasBase sqlAliasBase, SqlAstCreationState creationState)Objectdisassemble(Object value, SharedSessionContractImplementor session)EntityMappingTypefindContainingEntityMapping()EntityFetchgenerateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)Generates a Fetch of this fetchableEntityMappingTypegetAssociatedEntityMappingType()CollectionPersistergetCollectionDescriptor()intgetFetchableKey()The key that identifies this Fetchable within aFetchableContainer.StringgetFetchableName()The name of the fetchable.FetchOptionsgetMappedFetchOptions()The configured fetch timing and styleEntityMappingTypegetMappedType()Descriptor for the type of this mappingCollectionPart.NaturegetNature()NavigableRolegetNavigableRole()NotFoundActiongetNotFoundAction()intgetNumberOfFetchables()The number of fetchables in the containerStringgetSqlAliasStem()Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedFetchStylegetStyle()FetchTiminggetTiming()booleanincrementFetchDepth()Should this Fetchable affect the fetch depth? E.g., composites would generally not increment the fetch depth.booleanisOptional()booleanisUnwrapProxy()protected abstract AssociationKeyresolveFetchAssociationKey()StringtoString()-
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.metamodel.mapping.internal.EntityCollectionPart
addToCacheKey, finishInitialization, getCardinality, getEntityMappingType, getExpressibleJavaType, getJavaType, getJdbcTypeCount, getPartMappingType
-
Methods inherited from interface org.hibernate.metamodel.mapping.EntityValuedModelPart
applySqlSelections, applySqlSelections, findSubPart, findSubPart, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachSubPart, visitSubParts
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
asAttributeMapping, isSelectable, resolveCircularFetch
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getFetchable, getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, breakDownJdbcValues, decompose, decompose, hasPartitionedSelectionMapping, isEntityIdentifierMapping, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.metamodel.mapping.SelectableMappings
getSelectable
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValuedModelPart
forEachInsertable, forEachNonFormula, forEachSelectable, forEachSelectable, forEachUpdatable, getContainingTableExpression, getJdbcMappings, getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
treatAs
-
-
-
-
Constructor Detail
-
AbstractEntityCollectionPart
public AbstractEntityCollectionPart(CollectionPart.Nature nature, Collection collectionBootDescriptor, CollectionPersister collectionDescriptor, EntityMappingType associatedEntityTypeDescriptor, NotFoundAction notFoundAction, MappingModelCreationProcess creationProcess)
-
AbstractEntityCollectionPart
protected AbstractEntityCollectionPart(AbstractEntityCollectionPart original)
For Hibernate Reactive
-
-
Method Detail
-
getCollectionDescriptor
public CollectionPersister getCollectionDescriptor()
-
getMappedType
public EntityMappingType getMappedType()
Description copied from interface:ValueMappingDescriptor for the type of this mapping- Specified by:
getMappedTypein interfaceValueMapping
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRolein interfaceModelPart- See Also:
ModelPart.getPartName()
-
getNature
public CollectionPart.Nature getNature()
- Specified by:
getNaturein interfaceCollectionPart
-
getFetchableName
public String getFetchableName()
Description copied from interface:FetchableThe name of the fetchable. This is the part's "local name".- Specified by:
getFetchableNamein interfaceEntityCollectionPart- 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
-
getAssociatedEntityMappingType
public EntityMappingType getAssociatedEntityMappingType()
- Specified by:
getAssociatedEntityMappingTypein interfaceEntityCollectionPart
-
getNotFoundAction
public NotFoundAction getNotFoundAction()
- Specified by:
getNotFoundActionin interfaceEntityCollectionPart
-
getMappedFetchOptions
public FetchOptions getMappedFetchOptions()
Description copied from interface:FetchableThe configured fetch timing and style- Specified by:
getMappedFetchOptionsin interfaceFetchable
-
getStyle
public FetchStyle getStyle()
- Specified by:
getStylein interfaceFetchStyleAccess
-
getTiming
public FetchTiming getTiming()
- Specified by:
getTimingin interfaceFetchTimingAccess
-
incrementFetchDepth
public boolean incrementFetchDepth()
Description copied from interface:FetchableShould this Fetchable affect the fetch depth? E.g., composites would generally not increment the fetch depth.- Specified by:
incrementFetchDepthin interfaceFetchable- See Also:
AvailableSettings.MAX_FETCH_DEPTH
-
isOptional
public boolean isOptional()
- Specified by:
isOptionalin interfaceEntityValuedFetchable
-
isUnwrapProxy
public boolean isUnwrapProxy()
- Specified by:
isUnwrapProxyin interfaceEntityValuedFetchable
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
getNumberOfFetchables
public int getNumberOfFetchables()
Description copied from interface:FetchableContainerThe number of fetchables in the container- Specified by:
getNumberOfFetchablesin interfaceFetchableContainer
-
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 interfaceEntityValuedModelPart- Specified by:
createDomainResultin interfaceModelPart
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemblein interfaceBindable- Specified by:
disassemblein interfaceEntityValuedModelPart- See Also:
As an example, consider the following domain model: ````
-
generateFetch
public EntityFetch 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 interfaceEntityValuedFetchable- Specified by:
generateFetchin interfaceFetchable- Parameters:
fetchParent- The parent of the Fetch we are generatingfetchablePath- The overall path within the graphfetchTiming- The requested fetch timing
-
buildEagerCollectionFetch
protected EagerCollectionFetch buildEagerCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, TableGroup collectionTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)
For Hibernate Reactive
-
buildEntityFetchJoined
protected EntityFetch buildEntityFetchJoined(FetchParent fetchParent, AbstractEntityCollectionPart abstractEntityCollectionPart, TableGroup partTableGroup, NavigablePath fetchablePath, DomainResultCreationState creationState)
For Hibernate Reactive
-
resolveFetchAssociationKey
protected abstract AssociationKey resolveFetchAssociationKey()
-
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)
-
containsTableReference
public boolean containsTableReference(String tableExpression)
- Specified by:
containsTableReferencein interfaceTableGroupProducer
-
createTableGroupInternal
public TableGroup createTableGroupInternal(boolean canUseInnerJoins, NavigablePath navigablePath, boolean fetched, String sourceAlias, SqlAliasBase sqlAliasBase, SqlAstCreationState creationState)
-
-