Class AbstractCollectionInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
- java.lang.Object
-
- org.hibernate.sql.results.graph.internal.AbstractInitializer<Data>
-
- org.hibernate.sql.results.graph.collection.internal.AbstractCollectionInitializer<Data>
-
- All Implemented Interfaces:
CollectionInitializer<Data>
,Initializer<Data>
,InitializerParent<Data>
- Direct Known Subclasses:
AbstractImmediateCollectionInitializer
,AbstractNonJoinCollectionInitializer
public abstract class AbstractCollectionInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData> extends AbstractInitializer<Data> implements CollectionInitializer<Data>
Base support for CollectionInitializer implementations
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractCollectionInitializer.CollectionInitializerData
-
Nested classes/interfaces inherited from interface org.hibernate.sql.results.graph.Initializer
Initializer.State
-
-
Field Summary
Fields Modifier and Type Field Description protected PluralAttributeMapping
collectionAttributeMapping
protected @Nullable DomainResultAssembler<?>
collectionKeyResultAssembler
refers to the collection's container value - which collection-key?protected NavigablePath
collectionPath
protected boolean
isResultInitializer
protected @Nullable Type
keyTypeForEqualsHashCode
protected @Nullable EntityInitializer<InitializerData>
owningEntityInitializer
protected @Nullable InitializerParent<?>
parent
-
Fields inherited from class org.hibernate.sql.results.graph.internal.AbstractInitializer
initializerId
-
Fields inherited from interface org.hibernate.sql.results.graph.Initializer
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCollectionInitializer(NavigablePath collectionPath, PluralAttributeMapping collectionAttributeMapping, InitializerParent<?> parent, @Nullable DomainResult<?> collectionKeyResult, boolean isResultInitializer, AssemblerCreationState creationState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InitializerData
createInitializerData(RowProcessingState rowProcessingState)
protected void
forEachSubInitializer(BiConsumer<Initializer<?>,RowProcessingState> consumer, InitializerData data)
PluralAttributeMapping
getCollectionAttributeMapping()
@Nullable PersistentCollection<?>
getCollectionInstance(Data data)
PluralAttributeMapping
getInitializedPart()
NavigablePath
getNavigablePath()
@Nullable InitializerParent<?>
getParent()
Returns the parentInitializer
ornull
if this is a result initializer.boolean
hasLazySubInitializers()
Indicates whether this initializer has sub-initializers which are lazy.boolean
isEager()
Indicates whether calling resolve is needed when the object for this initializer is initialized already.boolean
isPartOfKey()
Indicates whether this initializer is part of a key i.e.boolean
isResultInitializer()
Indicates if this is a result or fetch initializer.protected void
resolveCollectionKey(Data data, boolean checkPreviousRow)
void
resolveFromPreviousRow(Data data)
Step 1.2 - Special variant ofInitializer.resolveKey(InitializerData)
that allows the reuse of key value and instance value from the previous row.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
resolveState(Data data)
protected void
setMissing(Data data)
-
Methods inherited from class org.hibernate.sql.results.graph.internal.AbstractInitializer
finishUpRow, getData, initializeInstance, startLoading
-
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, getCollectionInstance, getInitializingCollectionDescriptor, isCollectionInitializer
-
Methods inherited from interface org.hibernate.sql.results.graph.Initializer
asEmbeddableInitializer, asEntityInitializer, endLoading, endLoading, findOwningEntityInitializer, finishUpRow, finishUpRow, getData, getResolvedInstance, getResolvedInstance, initializeInstance, initializeInstance, initializeInstanceFromParent, initializeInstanceFromParent, isEmbeddableInitializer, isEntityInitializer, isLazyCapable, resolveFromPreviousRow, resolveInstance, resolveInstance, resolveInstance, resolveInstance, resolveKey, resolveState, startLoading
-
-
-
-
Field Detail
-
collectionPath
protected final NavigablePath collectionPath
-
collectionAttributeMapping
protected final PluralAttributeMapping collectionAttributeMapping
-
keyTypeForEqualsHashCode
protected final @Nullable Type keyTypeForEqualsHashCode
-
isResultInitializer
protected final boolean isResultInitializer
-
parent
protected final @Nullable InitializerParent<?> parent
-
owningEntityInitializer
protected final @Nullable EntityInitializer<InitializerData> owningEntityInitializer
-
collectionKeyResultAssembler
protected final @Nullable DomainResultAssembler<?> collectionKeyResultAssembler
refers to the collection's container value - which collection-key?
-
-
Constructor Detail
-
AbstractCollectionInitializer
protected AbstractCollectionInitializer(NavigablePath collectionPath, PluralAttributeMapping collectionAttributeMapping, InitializerParent<?> parent, @Nullable DomainResult<?> collectionKeyResult, boolean isResultInitializer, AssemblerCreationState creationState)
-
-
Method Detail
-
createInitializerData
protected InitializerData createInitializerData(RowProcessingState rowProcessingState)
- Specified by:
createInitializerData
in classAbstractInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
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 AbstractCollectionInitializer.CollectionInitializerData>
- Overrides:
resolveKey
in classAbstractInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
resolveState
public void resolveState(Data data)
- Specified by:
resolveState
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
resolveFromPreviousRow
public void resolveFromPreviousRow(Data data)
Description copied from interface:Initializer
Step 1.2 - Special variant ofInitializer.resolveKey(InitializerData)
that allows the reuse of key value and instance value from the previous row.- Specified by:
resolveFromPreviousRow
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
setMissing
protected void setMissing(Data data)
-
resolveCollectionKey
protected void resolveCollectionKey(Data data, boolean checkPreviousRow)
-
forEachSubInitializer
protected void forEachSubInitializer(BiConsumer<Initializer<?>,RowProcessingState> consumer, InitializerData data)
- Specified by:
forEachSubInitializer
in classAbstractInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
getCollectionInstance
public @Nullable PersistentCollection<?> getCollectionInstance(Data data)
- Specified by:
getCollectionInstance
in interfaceCollectionInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
getNavigablePath
public NavigablePath getNavigablePath()
- Specified by:
getNavigablePath
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
getCollectionAttributeMapping
public PluralAttributeMapping getCollectionAttributeMapping()
-
getInitializedPart
public PluralAttributeMapping getInitializedPart()
- Specified by:
getInitializedPart
in interfaceCollectionInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
- Specified by:
getInitializedPart
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
getParent
public @Nullable InitializerParent<?> getParent()
Description copied from interface:Initializer
Returns the parentInitializer
ornull
if this is a result initializer.- Specified by:
getParent
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
isPartOfKey
public boolean isPartOfKey()
Description copied from interface:Initializer
Indicates whether this initializer is part of a key i.e. entity identifier, foreign key or collection key.- Specified by:
isPartOfKey
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
isEager
public boolean isEager()
Description copied from interface:Initializer
Indicates whether calling resolve is needed when the object for this initializer is initialized already.- Specified by:
isEager
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
hasLazySubInitializers
public boolean hasLazySubInitializers()
Description copied from interface:Initializer
Indicates whether this initializer has sub-initializers which are lazy.- Specified by:
hasLazySubInitializers
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
isResultInitializer
public boolean isResultInitializer()
Description copied from interface:Initializer
Indicates if this is a result or fetch initializer.- Specified by:
isResultInitializer
in interfaceInitializer<Data extends AbstractCollectionInitializer.CollectionInitializerData>
-
-