Class NonAggregatedIdentifierMappingInitializer
- java.lang.Object
-
- org.hibernate.sql.results.graph.internal.AbstractInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
- org.hibernate.sql.results.graph.embeddable.internal.NonAggregatedIdentifierMappingInitializer
-
- All Implemented Interfaces:
EmbeddableInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
,Initializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
,InitializerParent<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
public class NonAggregatedIdentifierMappingInitializer extends AbstractInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData> implements EmbeddableInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData
-
Nested classes/interfaces inherited from interface org.hibernate.sql.results.graph.Initializer
Initializer.State
-
-
Field Summary
-
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 NonAggregatedIdentifierMappingInitializer(EmbeddableResultGraphNode resultDescriptor, InitializerParent<?> parent, AssemblerCreationState creationState, boolean isResultInitializer)
protected
NonAggregatedIdentifierMappingInitializer(EmbeddableResultGraphNode resultDescriptor, InitializerParent<?> parent, AssemblerCreationState creationState, boolean isResultInitializer, Function<Fetch,Fetch> fetchConverter)
-
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)
EmbeddableValuedModelPart
getInitializedPart()
protected @Nullable Initializer<InitializerData>[]
getInitializers()
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.void
initializeInstance(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
Step 3 - Initialize the state of the instance resolved inInitializer.resolveInstance(Data)
from the current row values.boolean
isEager()
Indicates whether calling resolve is needed when the object for this initializer is initialized already.boolean
isLazyCapable()
Indicates whether this initializer or one of its sub-parts could be made lazy.boolean
isPartOfKey()
Indicates whether this initializer is part of a key i.e.boolean
isResultInitializer()
Indicates if this is a result or fetch initializer.void
resetResolvedEntityRegistrations(RowProcessingState rowProcessingState)
Resets the resolved entity registrations by i.e.void
resolveFromPreviousRow(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
Step 1.2 - Special variant ofInitializer.resolveKey(InitializerData)
that allows the reuse of key value and instance value from the previous row.void
resolveInstance(@Nullable Object instance, NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
Step 2.2 - Use the given instance as resolved instance for this initializer.void
resolveInstance(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
Step 2.1 - Using the key resolved inInitializer.resolveKey(Data)
, resolve the instance (of the thing initialized) to use for the current row.void
resolveKey(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
Step 1.1 - Resolve the key value for this initializer for the current row and then recurse to the sub-initializers.void
resolveState(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
String
toString()
-
Methods inherited from class org.hibernate.sql.results.graph.internal.AbstractInitializer
finishUpRow, getData, startLoading
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.sql.results.graph.embeddable.EmbeddableInitializer
asEmbeddableInitializer, isEmbeddableInitializer
-
Methods inherited from interface org.hibernate.sql.results.graph.Initializer
asCollectionInitializer, asEntityInitializer, endLoading, endLoading, findOwningEntityInitializer, finishUpRow, finishUpRow, getData, getResolvedInstance, getResolvedInstance, initializeInstance, initializeInstanceFromParent, initializeInstanceFromParent, isCollectionInitializer, isEntityInitializer, resolveFromPreviousRow, resolveInstance, resolveInstance, resolveKey, resolveState, startLoading
-
-
-
-
Constructor Detail
-
NonAggregatedIdentifierMappingInitializer
public NonAggregatedIdentifierMappingInitializer(EmbeddableResultGraphNode resultDescriptor, InitializerParent<?> parent, AssemblerCreationState creationState, boolean isResultInitializer)
-
NonAggregatedIdentifierMappingInitializer
protected NonAggregatedIdentifierMappingInitializer(EmbeddableResultGraphNode resultDescriptor, InitializerParent<?> parent, AssemblerCreationState creationState, boolean isResultInitializer, Function<Fetch,Fetch> fetchConverter)
-
-
Method Detail
-
getInitializedPart
public EmbeddableValuedModelPart getInitializedPart()
- Specified by:
getInitializedPart
in interfaceEmbeddableInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
- Specified by:
getInitializedPart
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
getParent
public @Nullable InitializerParent<?> getParent()
Description copied from interface:Initializer
Returns the parentInitializer
ornull
if this is a result initializer.- Specified by:
getParent
in interfaceEmbeddableInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
- Specified by:
getParent
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
getNavigablePath
public NavigablePath getNavigablePath()
- Specified by:
getNavigablePath
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
isResultInitializer
public boolean isResultInitializer()
Description copied from interface:Initializer
Indicates if this is a result or fetch initializer.- Specified by:
isResultInitializer
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
createInitializerData
protected InitializerData createInitializerData(RowProcessingState rowProcessingState)
-
resolveKey
public void resolveKey(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData 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.
-
resetResolvedEntityRegistrations
public void resetResolvedEntityRegistrations(RowProcessingState rowProcessingState)
Description copied from interface:EmbeddableInitializer
Resets the resolved entity registrations by i.e. removingEntityHolder
. This is used afterEntityInitializer.resolveEntityKeyOnly(RowProcessingState)
to deregister registrations for entities that were only resolved, but not initialized. Failing to do this will lead to errors, becausePersistenceContext.postLoad(JdbcValuesSourceProcessingState, Consumer)
is called, which expects all registrations to be fully initialized.
-
resolveFromPreviousRow
public void resolveFromPreviousRow(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData 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<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
resolveInstance
public void resolveInstance(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
Description copied from interface:Initializer
Step 2.1 - Using the key resolved inInitializer.resolveKey(Data)
, 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. If the resolving was successful,Initializer.getResolvedInstance(RowProcessingState)
will return that instance.- Specified by:
resolveInstance
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
resolveInstance
public void resolveInstance(@Nullable Object instance, NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
Description copied from interface:Initializer
Step 2.2 - Use the given instance as resolved instance for this initializer. Initializers are supposed to recursively call this method for sub-initializers. This alternative initialization protocol is used when a parent instance was already part of the persistence context.- Specified by:
resolveInstance
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
initializeInstance
public void initializeInstance(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData 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
-
forEachSubInitializer
protected void forEachSubInitializer(BiConsumer<Initializer<?>,RowProcessingState> consumer, InitializerData data)
-
resolveState
public void resolveState(NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData data)
- Specified by:
resolveState
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
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<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
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<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
isLazyCapable
public boolean isLazyCapable()
Description copied from interface:Initializer
Indicates whether this initializer or one of its sub-parts could be made lazy.- Specified by:
isLazyCapable
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
hasLazySubInitializers
public boolean hasLazySubInitializers()
Description copied from interface:Initializer
Indicates whether this initializer has sub-initializers which are lazy.- Specified by:
hasLazySubInitializers
in interfaceInitializer<NonAggregatedIdentifierMappingInitializer.NonAggregatedIdentifierMappingInitializerData>
-
getInitializers
protected @Nullable Initializer<InitializerData>[] getInitializers()
-
-