Class AbstractImmediateCollectionInitializer
- java.lang.Object
-
- org.hibernate.sql.results.graph.collection.internal.AbstractCollectionInitializer
-
- org.hibernate.sql.results.graph.collection.internal.AbstractImmediateCollectionInitializer
-
- All Implemented Interfaces:
CollectionInitializer
,Initializer
- Direct Known Subclasses:
ArrayInitializer
,BagInitializer
,ListInitializer
,MapInitializer
,SetInitializer
public abstract class AbstractImmediateCollectionInitializer extends AbstractCollectionInitializer
Base support for CollectionInitializer implementations that represent an immediate initialization of some sort (join, select, batch, sub-select) for a persistent collection.
-
-
Field Summary
-
Fields inherited from class org.hibernate.sql.results.graph.collection.internal.AbstractCollectionInitializer
collectionAttributeMapping, collectionInstance, collectionKey, collectionKeyResultAssembler, parentAccess
-
-
Constructor Summary
Constructors Constructor Description AbstractImmediateCollectionInitializer(NavigablePath collectionPath, PluralAttributeMapping collectionAttributeMapping, FetchParentAccess parentAccess, LockMode lockMode, DomainResultAssembler<?> collectionKeyResultAssembler, DomainResultAssembler<?> collectionValueKeyResultAssembler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
finishUpRow(RowProcessingState rowProcessingState)
Lifecycle method called at the end of the current row processing.protected Object
getCollectionValueKey()
The value of the collection side of the collection key (FK).protected abstract String
getSimpleConcreteImplName()
void
initializeInstance(RowProcessingState rowProcessingState)
Step 3 - Initialize the state of the instance resolved inInitializer.resolveInstance(org.hibernate.sql.results.jdbc.spi.RowProcessingState)
from the current row values.protected abstract void
readCollectionRow(CollectionKey collectionKey, List<Object> loadingState, RowProcessingState rowProcessingState)
void
resolveInstance(RowProcessingState rowProcessingState)
Step 2 - Using the key resolved inInitializer.resolveKey(org.hibernate.sql.results.jdbc.spi.RowProcessingState)
, resolve the instance (of the thing initialized) to use for the current row.void
resolveKey(RowProcessingState rowProcessingState)
Step 1 - Resolve the key value for this initializer for the current row.protected void
takeResponsibility(RowProcessingState rowProcessingState, CollectionKey collectionKey)
-
Methods inherited from class org.hibernate.sql.results.graph.collection.internal.AbstractCollectionInitializer
getCollectionAttributeMapping, getCollectionInstance, getInitializedPart, getNavigablePath, getParentAccess, resolveCollectionKey, resolveInstance
-
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
endLoading, getInitializedInstance, getInitializingCollectionDescriptor, isCollectionInitializer
-
Methods inherited from interface org.hibernate.sql.results.graph.Initializer
asEmbeddableInitializer, asEntityInitializer, isAttributeAssignableToConcreteDescriptor, isEmbeddableInitializer, isEntityInitializer
-
-
-
-
Constructor Detail
-
AbstractImmediateCollectionInitializer
public AbstractImmediateCollectionInitializer(NavigablePath collectionPath, PluralAttributeMapping collectionAttributeMapping, FetchParentAccess parentAccess, LockMode lockMode, DomainResultAssembler<?> collectionKeyResultAssembler, DomainResultAssembler<?> collectionValueKeyResultAssembler)
-
-
Method Detail
-
getSimpleConcreteImplName
protected abstract String getSimpleConcreteImplName()
-
resolveInstance
public void resolveInstance(RowProcessingState rowProcessingState)
Description copied from interface:Initializer
Step 2 - Using the key resolved inInitializer.resolveKey(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..
-
takeResponsibility
protected void takeResponsibility(RowProcessingState rowProcessingState, CollectionKey collectionKey)
-
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
- Overrides:
resolveKey
in classAbstractCollectionInitializer
-
getCollectionValueKey
protected Object getCollectionValueKey()
The value of the collection side of the collection key (FK). Identifies inclusion in the collection. Can be null to indicate that the current row does not contain any collection values
-
initializeInstance
public void initializeInstance(RowProcessingState rowProcessingState)
Description copied from interface:Initializer
Step 3 - Initialize the state of the instance resolved inInitializer.resolveInstance(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
-
readCollectionRow
protected abstract void readCollectionRow(CollectionKey collectionKey, List<Object> loadingState, RowProcessingState rowProcessingState)
-
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
- Overrides:
finishUpRow
in classAbstractCollectionInitializer
-
-