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 class
AbstractCollectionInitializer.State
-
Field Summary
Fields Modifier and Type Field Description protected PluralAttributeMapping
collectionAttributeMapping
protected @Nullable PersistentCollection<?>
collectionInstance
protected @Nullable CollectionKey
collectionKey
protected @Nullable DomainResultAssembler<?>
collectionKeyResultAssembler
refers to the collection's container value - which collection-key?protected boolean
isResultInitializer
protected @Nullable FetchParentAccess
parentAccess
protected boolean
parentShallowCached
protected AbstractCollectionInitializer.State
state
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCollectionInitializer(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 void
endLoading(ExecutionContext executionContext)
Lifecycle method called at the very end of the result values processing@Nullable FetchParentAccess
findFirstEntityDescriptorAccess()
Find the first entity access up the fetch parent graphvoid
finishUpRow(RowProcessingState rowProcessingState)
Lifecycle method called at the end of the current row processing.PluralAttributeMapping
getCollectionAttributeMapping()
@Nullable PersistentCollection<?>
getCollectionInstance()
@Nullable FetchParentAccess
getFetchParentAccess()
PluralAttributeMapping
getInitializedPart()
NavigablePath
getNavigablePath()
@Nullable EntityMappingType
getOwnedModelPartDeclaringType()
@Nullable FetchParentAccess
getOwningParent()
Object
getParentKey()
boolean
isPartOfKey()
boolean
isResultInitializer()
void
markShallowCached()
void
registerResolutionListener(Consumer<Object> resolvedParentConsumer)
Register a listener to be notified when the parent is "resolved"@Nullable CollectionKey
resolveCollectionKey(RowProcessingState rowProcessingState)
protected void
resolveInstance(RowProcessingState rowProcessingState, boolean isEager)
void
resolveKey(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:Initializer
Step 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:
resolveKey
in interfaceInitializer
-
resolveInstance
protected void resolveInstance(RowProcessingState rowProcessingState, boolean isEager)
-
getCollectionInstance
public @Nullable PersistentCollection<?> getCollectionInstance()
- Specified by:
getCollectionInstance
in interfaceCollectionInitializer
-
getNavigablePath
public NavigablePath getNavigablePath()
- Specified by:
getNavigablePath
in interfaceFetchParentAccess
- Specified by:
getNavigablePath
in interfaceInitializer
-
getCollectionAttributeMapping
public PluralAttributeMapping getCollectionAttributeMapping()
-
getInitializedPart
public PluralAttributeMapping getInitializedPart()
- Specified by:
getInitializedPart
in interfaceCollectionInitializer
- Specified by:
getInitializedPart
in interfaceInitializer
-
getFetchParentAccess
public @Nullable FetchParentAccess getFetchParentAccess()
- Specified by:
getFetchParentAccess
in interfaceFetchParentAccess
-
getOwningParent
public @Nullable FetchParentAccess getOwningParent()
- Specified by:
getOwningParent
in interfaceFetchParentAccess
-
getOwnedModelPartDeclaringType
public @Nullable EntityMappingType getOwnedModelPartDeclaringType()
- Specified by:
getOwnedModelPartDeclaringType
in interfaceFetchParentAccess
-
findFirstEntityDescriptorAccess
public @Nullable FetchParentAccess findFirstEntityDescriptorAccess()
Description copied from interface:FetchParentAccess
Find the first entity access up the fetch parent graph- Specified by:
findFirstEntityDescriptorAccess
in interfaceFetchParentAccess
-
getParentKey
public Object getParentKey()
- Specified by:
getParentKey
in interfaceFetchParentAccess
-
registerResolutionListener
public void registerResolutionListener(Consumer<Object> resolvedParentConsumer)
Description copied from interface:FetchParentAccess
Register a listener to be notified when the parent is "resolved"- Specified by:
registerResolutionListener
in interfaceFetchParentAccess
-
isPartOfKey
public boolean isPartOfKey()
- Specified by:
isPartOfKey
in interfaceInitializer
-
isResultInitializer
public boolean isResultInitializer()
- Specified by:
isResultInitializer
in interfaceInitializer
-
resolveCollectionKey
public @Nullable CollectionKey resolveCollectionKey(RowProcessingState rowProcessingState)
- Specified by:
resolveCollectionKey
in interfaceCollectionInitializer
-
finishUpRow
public void finishUpRow(RowProcessingState rowProcessingState)
Description copied from interface:Initializer
Lifecycle 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:
finishUpRow
in interfaceInitializer
-
markShallowCached
public void markShallowCached()
- Specified by:
markShallowCached
in interfaceInitializer
-
endLoading
public void endLoading(ExecutionContext executionContext)
Description copied from interface:Initializer
Lifecycle method called at the very end of the result values processing- Specified by:
endLoading
in interfaceInitializer
-
-