Class EntityDelayedFetchInitializer
- java.lang.Object
-
- org.hibernate.sql.results.graph.entity.internal.EntityDelayedFetchInitializer
-
- All Implemented Interfaces:
EntityInitializer
,FetchParentAccess
,Initializer
public class EntityDelayedFetchInitializer extends Object implements EntityInitializer
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
parentShallowCached
-
Constructor Summary
Constructors Constructor Description EntityDelayedFetchInitializer(FetchParentAccess parentAccess, NavigablePath fetchedNavigable, ToOneAttributeMapping referencedModelPart, boolean selectByUniqueKey, DomainResultAssembler<?> identifierAssembler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endLoading(ExecutionContext executionContext)
Lifecycle method called at the very end of the result values processingvoid
finishUpRow(RowProcessingState rowProcessingState)
Lifecycle method called at the end of the current row processing.EntityPersister
getConcreteDescriptor()
EntityPersister
getEntityDescriptor()
Get the descriptor for the type of entity being initializedObject
getEntityInstance()
Get the entity instance for the currently processing "row".EntityKey
getEntityKey()
FetchParentAccess
getFetchParentAccess()
protected Object
getIdentifier()
protected DomainResultAssembler<?>
getIdentifierAssembler()
ModelPart
getInitializedPart()
NavigablePath
getNavigablePath()
@Nullable EntityMappingType
getOwnedModelPartDeclaringType()
@Nullable FetchParentAccess
getOwningParent()
Object
getParentKey()
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.boolean
isEntityInitialized()
boolean
isPartOfKey()
protected boolean
isProcessed()
boolean
isResultInitializer()
protected boolean
isSelectByUniqueKey()
void
markShallowCached()
void
registerResolutionListener(Consumer<Object> listener)
Register a listener to be notified when the parent is "resolved"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
setEntityInstance(Object entityInstance)
protected void
setIdentifier(Object identifier)
protected void
setProcessed(boolean processed)
String
toString()
-
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.entity.EntityInitializer
asEntityInitializer, findFirstEntityDescriptorAccess, findFirstEntityInitializer, getInitializedInstance, isEntityInitializer
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchParentAccess
shouldSkipInitializer
-
Methods inherited from interface org.hibernate.sql.results.graph.Initializer
asCollectionInitializer, asEmbeddableInitializer, initializeInstanceFromParent, isCollectionInitializer, isEmbeddableInitializer, startLoading
-
-
-
-
Constructor Detail
-
EntityDelayedFetchInitializer
public EntityDelayedFetchInitializer(FetchParentAccess parentAccess, NavigablePath fetchedNavigable, ToOneAttributeMapping referencedModelPart, boolean selectByUniqueKey, DomainResultAssembler<?> identifierAssembler)
-
-
Method Detail
-
getNavigablePath
public NavigablePath getNavigablePath()
- Specified by:
getNavigablePath
in interfaceFetchParentAccess
- Specified by:
getNavigablePath
in interfaceInitializer
-
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
-
getInitializedPart
public ModelPart getInitializedPart()
- Specified by:
getInitializedPart
in interfaceInitializer
-
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- Specified by:
resolveInstance
in interfaceInitializer
-
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- Specified by:
initializeInstance
in interfaceInitializer
-
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
-
markShallowCached
public void markShallowCached()
- Specified by:
markShallowCached
in interfaceInitializer
-
endLoading
public void endLoading(ExecutionContext executionContext)
Description copied from interface:Initializer
Lifecycle method called at the very end of the result values processing- Specified by:
endLoading
in interfaceInitializer
-
getEntityDescriptor
public EntityPersister getEntityDescriptor()
Description copied from interface:EntityInitializer
Get the descriptor for the type of entity being initialized- Specified by:
getEntityDescriptor
in interfaceEntityInitializer
-
getEntityInstance
public Object getEntityInstance()
Description copied from interface:EntityInitializer
Get the entity instance for the currently processing "row".- Specified by:
getEntityInstance
in interfaceEntityInitializer
-
isEntityInitialized
public boolean isEntityInitialized()
- Specified by:
isEntityInitialized
in interfaceEntityInitializer
- Returns:
- true if the current entity associated to this EntityInitializer has been initialized
-
getFetchParentAccess
public FetchParentAccess getFetchParentAccess()
- Specified by:
getFetchParentAccess
in interfaceFetchParentAccess
-
getOwningParent
public @Nullable FetchParentAccess getOwningParent()
- Specified by:
getOwningParent
in interfaceFetchParentAccess
-
getOwnedModelPartDeclaringType
public @Nullable EntityMappingType getOwnedModelPartDeclaringType()
- Specified by:
getOwnedModelPartDeclaringType
in interfaceFetchParentAccess
-
isPartOfKey
public boolean isPartOfKey()
- Specified by:
isPartOfKey
in interfaceInitializer
-
isResultInitializer
public boolean isResultInitializer()
- Specified by:
isResultInitializer
in interfaceInitializer
-
getConcreteDescriptor
public EntityPersister getConcreteDescriptor()
- Specified by:
getConcreteDescriptor
in interfaceEntityInitializer
-
setEntityInstance
protected void setEntityInstance(Object entityInstance)
-
setProcessed
protected void setProcessed(boolean processed)
-
isProcessed
protected boolean isProcessed()
-
getIdentifier
protected Object getIdentifier()
-
setIdentifier
protected void setIdentifier(Object identifier)
-
isSelectByUniqueKey
protected boolean isSelectByUniqueKey()
-
getIdentifierAssembler
protected DomainResultAssembler<?> getIdentifierAssembler()
-
getEntityKey
public EntityKey getEntityKey()
- Specified by:
getEntityKey
in interfaceEntityInitializer
-
getParentKey
public Object getParentKey()
- Specified by:
getParentKey
in interfaceFetchParentAccess
-
registerResolutionListener
public void registerResolutionListener(Consumer<Object> listener)
Description copied from interface:FetchParentAccess
Register a listener to be notified when the parent is "resolved"- Specified by:
registerResolutionListener
in interfaceFetchParentAccess
-
-