Class AbstractInitializer<Data extends InitializerData>
- java.lang.Object
-
- org.hibernate.sql.results.graph.internal.AbstractInitializer<Data>
-
- All Implemented Interfaces:
Initializer<Data>
- Direct Known Subclasses:
AbstractCollectionInitializer
,DiscriminatedEntityInitializer
,EmbeddableInitializerImpl
,EntityDelayedFetchInitializer
,EntityInitializerImpl
,EntitySelectFetchInitializer
,NonAggregatedIdentifierMappingInitializer
public abstract class AbstractInitializer<Data extends InitializerData> extends Object implements Initializer<Data>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.sql.results.graph.Initializer
Initializer.State
-
-
Field Summary
Fields Modifier and Type Field Description protected int
initializerId
-
Fields inherited from interface org.hibernate.sql.results.graph.Initializer
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractInitializer(AssemblerCreationState creationState)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract InitializerData
createInitializerData(RowProcessingState rowProcessingState)
void
finishUpRow(Data data)
Lifecycle method called at the end of the current row processing.protected abstract void
forEachSubInitializer(BiConsumer<Initializer<?>,RowProcessingState> consumer, InitializerData data)
Data
getData(RowProcessingState rowProcessingState)
The current data of this initializer.void
initializeInstance(Data data)
Step 3 - Initialize the state of the instance resolved inInitializer.resolveInstance(Data)
from the current row values.void
resolveKey(Data data)
Step 1.1 - Resolve the key value for this initializer for the current row and then recurse to the sub-initializers.void
startLoading(RowProcessingState rowProcessingState)
Step 0 - Callback for initializers before the first row is read.-
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.Initializer
asCollectionInitializer, asEmbeddableInitializer, asEntityInitializer, endLoading, endLoading, findOwningEntityInitializer, finishUpRow, getInitializedPart, getNavigablePath, getParent, getResolvedInstance, getResolvedInstance, hasLazySubInitializers, initializeInstance, initializeInstanceFromParent, initializeInstanceFromParent, isCollectionInitializer, isEager, isEmbeddableInitializer, isEntityInitializer, isLazyCapable, isPartOfKey, isResultInitializer, resolveFromPreviousRow, resolveFromPreviousRow, resolveInstance, resolveInstance, resolveInstance, resolveInstance, resolveKey, resolveState, resolveState
-
-
-
-
Constructor Detail
-
AbstractInitializer
protected AbstractInitializer(AssemblerCreationState creationState)
-
-
Method Detail
-
startLoading
public void startLoading(RowProcessingState rowProcessingState)
Description copied from interface:Initializer
Step 0 - Callback for initializers before the first row is read. It is the responsibility of this initializer to recurse to the sub-initializers and registerInitializerData
for the initializer id viaRowProcessingState.setInitializerData(int, InitializerData)
. This is useful for e.g. preparing initializers in case of a cache hit.- Specified by:
startLoading
in interfaceInitializer<Data extends InitializerData>
-
createInitializerData
protected abstract InitializerData createInitializerData(RowProcessingState rowProcessingState)
-
resolveKey
public void resolveKey(Data data)
Description copied from interface:Initializer
Step 1.1 - Resolve the key value for this initializer for the current row and then recurse to the sub-initializers. After this point, the initializer knows whether further processing is necessary for the current row i.e. if the object is missing.- Specified by:
resolveKey
in interfaceInitializer<Data extends InitializerData>
-
initializeInstance
public void initializeInstance(Data data)
Description copied from interface:Initializer
Step 3 - Initialize the state of the instance resolved inInitializer.resolveInstance(Data)
from the current row values. All resolved state for the current row is injected into the resolved instance- Specified by:
initializeInstance
in interfaceInitializer<Data extends InitializerData>
-
getData
public Data getData(RowProcessingState rowProcessingState)
Description copied from interface:Initializer
The current data of this initializer.- Specified by:
getData
in interfaceInitializer<Data extends InitializerData>
-
finishUpRow
public void finishUpRow(Data data)
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<Data extends InitializerData>
-
forEachSubInitializer
protected abstract void forEachSubInitializer(BiConsumer<Initializer<?>,RowProcessingState> consumer, InitializerData data)
-
-