Package org.hibernate.sql.results.graph
Interface Initializer
-
- All Known Subinterfaces:
AggregateEmbeddableInitializer,CollectionInitializer,EmbeddableInitializer,EntityInitializer,FetchParentAccess
- All Known Implementing Classes:
AbstractBatchEntitySelectFetchInitializer,AbstractCollectionInitializer,AbstractEmbeddableInitializer,AbstractEntityInitializer,AbstractFetchParentAccess,AbstractImmediateCollectionInitializer,AbstractNonAggregatedIdentifierMappingInitializer,AggregateEmbeddableFetchInitializer,AggregateEmbeddableResultInitializer,ArrayInitializer,BagInitializer,BatchEntityInsideEmbeddableSelectFetchInitializer,BatchEntitySelectFetchInitializer,BatchInitializeEntitySelectFetchInitializer,DelayedCollectionInitializer,EmbeddableFetchInitializer,EmbeddableResultInitializer,EntityDelayedFetchInitializer,EntityJoinedFetchInitializer,EntityResultInitializer,EntitySelectFetchByUniqueKeyInitializer,EntitySelectFetchInitializer,ListInitializer,MapInitializer,NonAggregatedIdentifierMappingFetchInitializer,NonAggregatedIdentifierMappingResultInitializer,SelectEagerCollectionInitializer,SetInitializer
@Incubating public interface Initializer
Defines a multi-step process for initializing entity, collection and composite state. Each step is performed on each initializer before starting the next step.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default EmbeddableInitializerasEmbeddableInitializer()A utility method to avoid casting explicitly to EmbeddableInitializerdefault EntityInitializerasEntityInitializer()A utility method to avoid casting explicitly to EntityInitializerdefault voidendLoading(ExecutionContext context)Lifecycle method called at the very end of the result values processingvoidfinishUpRow(RowProcessingState rowProcessingState)Lifecycle method called at the end of the current row processing.ObjectgetInitializedInstance()ModelPartgetInitializedPart()NavigablePathgetNavigablePath()voidinitializeInstance(RowProcessingState rowProcessingState)Step 3 - Initialize the state of the instance resolved inresolveInstance(org.hibernate.sql.results.jdbc.spi.RowProcessingState)from the current row values.default booleanisAttributeAssignableToConcreteDescriptor(FetchParentAccess parentAccess, AttributeMapping referencedModelPart)default booleanisCollectionInitializer()default booleanisEmbeddableInitializer()default booleanisEntityInitializer()voidresolveInstance(RowProcessingState rowProcessingState)Step 2 - Using the key resolved inresolveKey(org.hibernate.sql.results.jdbc.spi.RowProcessingState), resolve the instance (of the thing initialized) to use for the current row.voidresolveKey(RowProcessingState rowProcessingState)Step 1 - Resolve the key value for this initializer for the current row.
-
-
-
Method Detail
-
getNavigablePath
NavigablePath getNavigablePath()
-
getInitializedPart
ModelPart getInitializedPart()
-
getInitializedInstance
Object getInitializedInstance()
-
resolveKey
void resolveKey(RowProcessingState rowProcessingState)
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
-
resolveInstance
void resolveInstance(RowProcessingState rowProcessingState)
Step 2 - Using the key resolved inresolveKey(org.hibernate.sql.results.jdbc.spi.RowProcessingState), resolve the instance (of the thing initialized) to use for the current row. After this point, the initializer knows the entity/collection/component instance for the current row based on the resolved key todo (6.0) : much of the various implementations of this are similar enough to handle in a common base implementation (templating?) things like resolving as managed (Session cache), from second-level cache, from LoadContext, etc..
-
initializeInstance
void initializeInstance(RowProcessingState rowProcessingState)
Step 3 - Initialize the state of the instance resolved inresolveInstance(org.hibernate.sql.results.jdbc.spi.RowProcessingState)from the current row values. All resolved state for the current row is injected into the resolved instance
-
finishUpRow
void finishUpRow(RowProcessingState rowProcessingState)
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.
-
endLoading
default void endLoading(ExecutionContext context)
Lifecycle method called at the very end of the result values processing
-
isAttributeAssignableToConcreteDescriptor
default boolean isAttributeAssignableToConcreteDescriptor(FetchParentAccess parentAccess, AttributeMapping referencedModelPart)
-
isEmbeddableInitializer
default boolean isEmbeddableInitializer()
-
isEntityInitializer
default boolean isEntityInitializer()
-
isCollectionInitializer
default boolean isCollectionInitializer()
-
asEntityInitializer
default EntityInitializer asEntityInitializer()
A utility method to avoid casting explicitly to EntityInitializer- Returns:
- EntityInitializer if this is an instance of EntityInitializer otherwise
null
-
asEmbeddableInitializer
default EmbeddableInitializer asEmbeddableInitializer()
A utility method to avoid casting explicitly to EmbeddableInitializer- Returns:
- EmbeddableInitializer if this is an instance of EmbeddableInitializer otherwise
null
-
-