Class EmbeddableInitializerImpl
- All Implemented Interfaces:
EmbeddableInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>,Initializer<EmbeddableInitializerImpl.EmbeddableInitializerData>,InitializerParent<EmbeddableInitializerImpl.EmbeddableInitializerData>
- Direct Known Subclasses:
AggregateEmbeddableInitializerImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from interface org.hibernate.sql.results.graph.Initializer
Initializer.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DomainResultAssembler<?>[][]protected final @Nullable Initializer<InitializerData>[][]protected final BasicResultAssembler<?>protected final booleanprotected final booleanprotected final @Nullable DomainResultAssembler<Boolean>protected final @Nullable Initializer<InitializerData>[][]protected final @Nullable Initializer<InitializerData>[][]Fields inherited from class org.hibernate.sql.results.graph.internal.AbstractInitializer
initializerIdFields inherited from interface org.hibernate.sql.results.graph.Initializer
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionEmbeddableInitializerImpl(EmbeddableResultGraphNode resultDescriptor, BasicFetch<?> discriminatorFetch, @Nullable DomainResult<Boolean> nullIndicatorResult, InitializerParent<?> parent, AssemblerCreationState creationState, boolean isResultInitializer) EmbeddableInitializerImpl(EmbeddableResultGraphNode resultDescriptor, BasicFetch<?> discriminatorFetch, InitializerParent<?> parent, AssemblerCreationState creationState, boolean isResultInitializer) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected InitializerDatacreateInitializerData(RowProcessingState rowProcessingState) protected voidprotected voidforEachSubInitializer(BiConsumer<Initializer<?>, RowProcessingState> consumer, InitializerData data) @Nullable InitializerParent<?>Returns the parentInitializerornullif this is a result initializer.booleanIndicates whether this initializer has sub-initializers which are lazy.voidStep 3 - Initialize the state of the instance resolved inInitializer.resolveInstance(Data)from the current row values.voidinitializeInstanceFromParent(Object parentInstance, EmbeddableInitializerImpl.EmbeddableInitializerData data) Step 3.1 - Initialize the state of the instance as extracted from the givenparentInstance.booleanisEager()Indicates whether calling resolve is needed when the object for this initializer is initialized already.booleanIndicates whether this initializer or one of its sub-parts could be made lazy.protected booleanbooleanIndicates whether this initializer is part of a key i.e.booleanIndicates if this is a result or fetch initializer.voidresetResolvedEntityRegistrations(RowProcessingState rowProcessingState) Resets the resolved entity registrations by i.e.voidStep 1.2 - Special variant ofInitializer.resolveKey(InitializerData)that allows the reuse of key value and instance value from the previous row.voidresolveInstance(@Nullable Object instance, EmbeddableInitializerImpl.EmbeddableInitializerData data) Step 2.2 - Use the given instance as resolved instance for this initializer.voidStep 2.1 - Using the key resolved inInitializer.resolveKey(Data), resolve the instance (of the thing initialized) to use for the current row.voidStep 1.1 - Resolve the key value for this initializer for the current row and then recurse to the sub-initializers.voidtoString()Methods inherited from class org.hibernate.sql.results.graph.internal.AbstractInitializer
finishUpRow, getData, startLoadingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.sql.results.graph.embeddable.EmbeddableInitializer
asEmbeddableInitializer, isEmbeddableInitializerMethods inherited from interface org.hibernate.sql.results.graph.Initializer
asCollectionInitializer, asEntityInitializer, endLoading, findOwningEntityInitializer, finishUpRow, getData, getResolvedInstance, getResolvedInstance, initializeInstance, initializeInstanceFromParent, isCollectionInitializer, isEntityInitializer, resolveFromPreviousRow, resolveInstance, resolveInstance, resolveKey, resolveState, startLoading
-
Field Details
-
assemblers
-
discriminatorAssembler
-
nullIndicatorAssembler
-
subInitializers
-
subInitializersForResolveFromInitialized
-
collectionContainingSubInitializers
-
lazyCapable
protected final boolean lazyCapable -
hasLazySubInitializer
protected final boolean hasLazySubInitializer
-
-
Constructor Details
-
EmbeddableInitializerImpl
@Deprecated(forRemoval=true) public EmbeddableInitializerImpl(EmbeddableResultGraphNode resultDescriptor, BasicFetch<?> discriminatorFetch, InitializerParent<?> parent, AssemblerCreationState creationState, boolean isResultInitializer) Deprecated, for removal: This API element is subject to removal in a future version. -
EmbeddableInitializerImpl
public EmbeddableInitializerImpl(EmbeddableResultGraphNode resultDescriptor, BasicFetch<?> discriminatorFetch, @Nullable DomainResult<Boolean> nullIndicatorResult, InitializerParent<?> parent, AssemblerCreationState creationState, boolean isResultInitializer)
-
-
Method Details
-
getInitializedPart
- Specified by:
getInitializedPartin interfaceEmbeddableInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>- Specified by:
getInitializedPartin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
getParent
Description copied from interface:InitializerReturns the parentInitializerornullif this is a result initializer.- Specified by:
getParentin interfaceEmbeddableInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>- Specified by:
getParentin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
isResultInitializer
public boolean isResultInitializer()Description copied from interface:InitializerIndicates if this is a result or fetch initializer.- Specified by:
isResultInitializerin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
isPartOfKey
public boolean isPartOfKey()Description copied from interface:InitializerIndicates whether this initializer is part of a key i.e. entity identifier, foreign key or collection key.- Specified by:
isPartOfKeyin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
isEager
public boolean isEager()Description copied from interface:InitializerIndicates whether calling resolve is needed when the object for this initializer is initialized already.- Specified by:
isEagerin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
isLazyCapable
public boolean isLazyCapable()Description copied from interface:InitializerIndicates whether this initializer or one of its sub-parts could be made lazy.- Specified by:
isLazyCapablein interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
hasLazySubInitializers
public boolean hasLazySubInitializers()Description copied from interface:InitializerIndicates whether this initializer has sub-initializers which are lazy.- Specified by:
hasLazySubInitializersin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
createInitializerData
- Specified by:
createInitializerDatain classAbstractInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
resolveKey
Description copied from interface:InitializerStep 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:
resolveKeyin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>- Overrides:
resolveKeyin classAbstractInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
resetResolvedEntityRegistrations
Description copied from interface:EmbeddableInitializerResets 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.- Specified by:
resetResolvedEntityRegistrationsin interfaceEmbeddableInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
resolveFromPreviousRow
Description copied from interface:InitializerStep 1.2 - Special variant ofInitializer.resolveKey(InitializerData)that allows the reuse of key value and instance value from the previous row.- Specified by:
resolveFromPreviousRowin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
resolveInstance
Description copied from interface:InitializerStep 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:
resolveInstancein interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
resolveInstance
public void resolveInstance(@Nullable Object instance, EmbeddableInitializerImpl.EmbeddableInitializerData data) Description copied from interface:InitializerStep 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:
resolveInstancein interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
initializeInstance
Description copied from interface:InitializerStep 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:
initializeInstancein interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>- Overrides:
initializeInstancein classAbstractInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
forEachSubInitializer
protected void forEachSubInitializer(BiConsumer<Initializer<?>, RowProcessingState> consumer, InitializerData data) - Specified by:
forEachSubInitializerin classAbstractInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
initializeInstanceFromParent
public void initializeInstanceFromParent(Object parentInstance, EmbeddableInitializerImpl.EmbeddableInitializerData data) Description copied from interface:InitializerStep 3.1 - Initialize the state of the instance as extracted from the givenparentInstance. Extraction can be done with theInitializer.getInitializedPart(). Initializers are supposed to recursively call this method for sub-initializers.This alternative initialization protocol is used for shallow query cache hits, in which case there is no data available in the
JdbcValuesCacheHitto initialize potentially lazy associations.- Specified by:
initializeInstanceFromParentin interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
extractRowState
-
isNull
-
resolveState
- Specified by:
resolveStatein interfaceInitializer<EmbeddableInitializerImpl.EmbeddableInitializerData>
-
toString
-