Class AbstractCollectionInitializer
- java.lang.Object
-
- org.hibernate.sql.results.graph.collection.internal.AbstractCollectionInitializer
-
- All Implemented Interfaces:
CollectionInitializer,FetchParentAccess,Initializer
- Direct Known Subclasses:
AbstractImmediateCollectionInitializer,DelayedCollectionInitializer,SelectEagerCollectionInitializer
public abstract class AbstractCollectionInitializer extends Object implements CollectionInitializer
Base support for CollectionInitializer implementations
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractCollectionInitializer.State
-
Field Summary
Fields Modifier and Type Field Description protected PluralAttributeMappingcollectionAttributeMappingprotected @Nullable PersistentCollection<?>collectionInstanceprotected @Nullable CollectionKeycollectionKeyprotected @Nullable DomainResultAssembler<?>collectionKeyResultAssemblerrefers to the collection's container value - which collection-key?protected booleanisResultInitializerprotected @Nullable FetchParentAccessparentAccessprotected booleanparentShallowCachedprotected AbstractCollectionInitializer.Statestate
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCollectionInitializer(NavigablePath collectionPath, PluralAttributeMapping collectionAttributeMapping, FetchParentAccess parentAccess, @Nullable DomainResult<?> collectionKeyResult, boolean isResultInitializer, AssemblerCreationState creationState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendLoading(ExecutionContext executionContext)Lifecycle method called at the very end of the result values processing@Nullable FetchParentAccessfindFirstEntityDescriptorAccess()Find the first entity access up the fetch parent graphvoidfinishUpRow(RowProcessingState rowProcessingState)Lifecycle method called at the end of the current row processing.PluralAttributeMappinggetCollectionAttributeMapping()@Nullable PersistentCollection<?>getCollectionInstance()@Nullable FetchParentAccessgetFetchParentAccess()PluralAttributeMappinggetInitializedPart()NavigablePathgetNavigablePath()@Nullable EntityMappingTypegetOwnedModelPartDeclaringType()@Nullable FetchParentAccessgetOwningParent()ObjectgetParentKey()booleanisPartOfKey()booleanisResultInitializer()voidmarkShallowCached()voidregisterResolutionListener(Consumer<Object> resolvedParentConsumer)Register a listener to be notified when the parent is "resolved"@Nullable CollectionKeyresolveCollectionKey(RowProcessingState rowProcessingState)protected voidresolveInstance(RowProcessingState rowProcessingState, boolean isEager)voidresolveKey(RowProcessingState rowProcessingState)Step 1 - Resolve the key value for this initializer for the current row.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.sql.results.graph.collection.CollectionInitializer
asCollectionInitializer, getInitializedInstance, getInitializingCollectionDescriptor, isCollectionInitializer
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchParentAccess
findFirstEntityInitializer, shouldSkipInitializer
-
Methods inherited from interface org.hibernate.sql.results.graph.Initializer
asEmbeddableInitializer, asEntityInitializer, initializeInstance, initializeInstanceFromParent, isEmbeddableInitializer, isEntityInitializer, resolveInstance, startLoading
-
-
-
-
Field Detail
-
collectionAttributeMapping
protected final PluralAttributeMapping collectionAttributeMapping
-
isResultInitializer
protected final boolean isResultInitializer
-
parentAccess
protected final @Nullable FetchParentAccess parentAccess
-
collectionKeyResultAssembler
protected final @Nullable DomainResultAssembler<?> collectionKeyResultAssembler
refers to the collection's container value - which collection-key?
-
collectionInstance
protected @Nullable PersistentCollection<?> collectionInstance
-
collectionKey
protected @Nullable CollectionKey collectionKey
-
parentShallowCached
protected boolean parentShallowCached
-
state
protected AbstractCollectionInitializer.State state
-
-
Constructor Detail
-
AbstractCollectionInitializer
protected AbstractCollectionInitializer(NavigablePath collectionPath, PluralAttributeMapping collectionAttributeMapping, FetchParentAccess parentAccess, @Nullable DomainResult<?> collectionKeyResult, boolean isResultInitializer, AssemblerCreationState creationState)
-
-
Method Detail
-
resolveKey
public void resolveKey(RowProcessingState rowProcessingState)
Description copied from interface:InitializerStep 1 - Resolve the key value for this initializer for the current row. After this point, the initializer knows the entity/collection/component key for the current row- Specified by:
resolveKeyin interfaceInitializer
-
resolveInstance
protected void resolveInstance(RowProcessingState rowProcessingState, boolean isEager)
-
getCollectionInstance
public @Nullable PersistentCollection<?> getCollectionInstance()
- Specified by:
getCollectionInstancein interfaceCollectionInitializer
-
getNavigablePath
public NavigablePath getNavigablePath()
- Specified by:
getNavigablePathin interfaceFetchParentAccess- Specified by:
getNavigablePathin interfaceInitializer
-
getCollectionAttributeMapping
public PluralAttributeMapping getCollectionAttributeMapping()
-
getInitializedPart
public PluralAttributeMapping getInitializedPart()
- Specified by:
getInitializedPartin interfaceCollectionInitializer- Specified by:
getInitializedPartin interfaceInitializer
-
getFetchParentAccess
public @Nullable FetchParentAccess getFetchParentAccess()
- Specified by:
getFetchParentAccessin interfaceFetchParentAccess
-
getOwningParent
public @Nullable FetchParentAccess getOwningParent()
- Specified by:
getOwningParentin interfaceFetchParentAccess
-
getOwnedModelPartDeclaringType
public @Nullable EntityMappingType getOwnedModelPartDeclaringType()
- Specified by:
getOwnedModelPartDeclaringTypein interfaceFetchParentAccess
-
findFirstEntityDescriptorAccess
public @Nullable FetchParentAccess findFirstEntityDescriptorAccess()
Description copied from interface:FetchParentAccessFind the first entity access up the fetch parent graph- Specified by:
findFirstEntityDescriptorAccessin interfaceFetchParentAccess
-
getParentKey
public Object getParentKey()
- Specified by:
getParentKeyin interfaceFetchParentAccess
-
registerResolutionListener
public void registerResolutionListener(Consumer<Object> resolvedParentConsumer)
Description copied from interface:FetchParentAccessRegister a listener to be notified when the parent is "resolved"- Specified by:
registerResolutionListenerin interfaceFetchParentAccess
-
isPartOfKey
public boolean isPartOfKey()
- Specified by:
isPartOfKeyin interfaceInitializer
-
isResultInitializer
public boolean isResultInitializer()
- Specified by:
isResultInitializerin interfaceInitializer
-
resolveCollectionKey
public @Nullable CollectionKey resolveCollectionKey(RowProcessingState rowProcessingState)
- Specified by:
resolveCollectionKeyin interfaceCollectionInitializer
-
finishUpRow
public void finishUpRow(RowProcessingState rowProcessingState)
Description copied from interface:InitializerLifecycle method called at the end of the current row processing. Provides ability to complete processing from the current row and prepare for the next row.- Specified by:
finishUpRowin interfaceInitializer
-
markShallowCached
public void markShallowCached()
- Specified by:
markShallowCachedin interfaceInitializer
-
endLoading
public void endLoading(ExecutionContext executionContext)
Description copied from interface:InitializerLifecycle method called at the very end of the result values processing- Specified by:
endLoadingin interfaceInitializer
-
-