Class AbstractBatchEntitySelectFetchInitializer
- java.lang.Object
-
- org.hibernate.sql.results.graph.AbstractFetchParentAccess
-
- org.hibernate.sql.results.graph.entity.internal.AbstractBatchEntitySelectFetchInitializer
-
- All Implemented Interfaces:
EntityInitializer,FetchParentAccess,Initializer
- Direct Known Subclasses:
BatchEntityInsideEmbeddableSelectFetchInitializer,BatchEntitySelectFetchInitializer,BatchInitializeEntitySelectFetchInitializer
public abstract class AbstractBatchEntitySelectFetchInitializer extends AbstractFetchParentAccess implements EntityInitializer
-
-
Field Summary
Fields Modifier and Type Field Description protected EntityPersisterconcreteDescriptorprotected EntityKeyentityKeyprotected EntityInitializerfirstEntityInitializerprotected DomainResultAssembler<?>identifierAssemblerprotected ObjectinitializedEntityInstanceprotected FetchParentAccessparentAccessprotected ToOneAttributeMappingreferencedModelPartprotected org.hibernate.sql.results.graph.entity.internal.AbstractBatchEntitySelectFetchInitializer.Statestate
-
Constructor Summary
Constructors Constructor Description AbstractBatchEntitySelectFetchInitializer(FetchParentAccess parentAccess, ToOneAttributeMapping referencedModelPart, NavigablePath fetchedNavigable, EntityPersister concreteDescriptor, DomainResultAssembler<?> identifierAssembler)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidfinishUpRow(RowProcessingState rowProcessingState)Lifecycle method called at the end of the current row processing.EntityPersistergetConcreteDescriptor()EntityPersistergetEntityDescriptor()Get the descriptor for the type of entity being initializedObjectgetEntityInstance()Get the entity instance for the currently processing "row".EntityKeygetEntityKey()protected ObjectgetExistingInitializedInstance(RowProcessingState rowProcessingState)FetchParentAccessgetFetchParentAccess()ModelPartgetInitializedPart()NavigablePathgetNavigablePath()protected AttributeMappinggetParentEntityAttribute(String attributeName)ObjectgetParentKey()voidinitializeInstance(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 static ObjectloadInstance(EntityKey entityKey, ToOneAttributeMapping referencedModelPart, SharedSessionContractImplementor session)protected abstract voidregisterResolutionListener()voidregisterResolutionListener(Consumer<Object> listener)Register a listener to be notified when the parent is "resolved"protected voidregisterToBatchFetchQueue(RowProcessingState rowProcessingState)voidresolveKey(RowProcessingState rowProcessingState)Step 1 - Resolve the key value for this initializer for the current row.protected voidresolveKey(RowProcessingState rowProcessingState, ToOneAttributeMapping referencedModelPart, FetchParentAccess parentAccess)-
Methods inherited from class org.hibernate.sql.results.graph.AbstractFetchParentAccess
clearResolutionListeners, notifyResolutionListeners
-
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.entity.EntityInitializer
asEntityInitializer, findFirstEntityDescriptorAccess, findFirstEntityInitializer, getInitializedInstance, isEntityInitialized, isEntityInitializer
-
Methods inherited from interface org.hibernate.sql.results.graph.Initializer
asEmbeddableInitializer, endLoading, isAttributeAssignableToConcreteDescriptor, isCollectionInitializer, isEmbeddableInitializer, resolveInstance
-
-
-
-
Field Detail
-
parentAccess
protected final FetchParentAccess parentAccess
-
concreteDescriptor
protected final EntityPersister concreteDescriptor
-
identifierAssembler
protected final DomainResultAssembler<?> identifierAssembler
-
referencedModelPart
protected final ToOneAttributeMapping referencedModelPart
-
firstEntityInitializer
protected final EntityInitializer firstEntityInitializer
-
initializedEntityInstance
protected Object initializedEntityInstance
-
entityKey
protected EntityKey entityKey
-
state
protected org.hibernate.sql.results.graph.entity.internal.AbstractBatchEntitySelectFetchInitializer.State state
-
-
Constructor Detail
-
AbstractBatchEntitySelectFetchInitializer
public AbstractBatchEntitySelectFetchInitializer(FetchParentAccess parentAccess, ToOneAttributeMapping referencedModelPart, NavigablePath fetchedNavigable, EntityPersister concreteDescriptor, DomainResultAssembler<?> identifierAssembler)
-
-
Method Detail
-
getInitializedPart
public ModelPart getInitializedPart()
- Specified by:
getInitializedPartin interfaceInitializer
-
getNavigablePath
public NavigablePath getNavigablePath()
- Specified by:
getNavigablePathin interfaceFetchParentAccess- Specified by:
getNavigablePathin interfaceInitializer
-
resolveKey
public void resolveKey(RowProcessingState rowProcessingState)
Description copied from interface:InitializerStep 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:
resolveKeyin interfaceInitializer
-
initializeInstance
public void initializeInstance(RowProcessingState rowProcessingState)
Description copied from interface:InitializerStep 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:
initializeInstancein interfaceInitializer
-
registerResolutionListener
protected abstract void registerResolutionListener()
-
resolveKey
protected void resolveKey(RowProcessingState rowProcessingState, ToOneAttributeMapping referencedModelPart, FetchParentAccess parentAccess)
-
getExistingInitializedInstance
protected Object getExistingInitializedInstance(RowProcessingState rowProcessingState)
-
registerToBatchFetchQueue
protected void registerToBatchFetchQueue(RowProcessingState rowProcessingState)
-
finishUpRow
public void finishUpRow(RowProcessingState rowProcessingState)
Description copied from interface:InitializerLifecycle 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:
finishUpRowin interfaceInitializer
-
getEntityDescriptor
public EntityPersister getEntityDescriptor()
Description copied from interface:EntityInitializerGet the descriptor for the type of entity being initialized- Specified by:
getEntityDescriptorin interfaceEntityInitializer
-
getEntityInstance
public Object getEntityInstance()
Description copied from interface:EntityInitializerGet the entity instance for the currently processing "row".- Specified by:
getEntityInstancein interfaceEntityInitializer
-
getEntityKey
public EntityKey getEntityKey()
- Specified by:
getEntityKeyin interfaceEntityInitializer
-
getParentKey
public Object getParentKey()
- Specified by:
getParentKeyin interfaceFetchParentAccess
-
registerResolutionListener
public void registerResolutionListener(Consumer<Object> listener)
Description copied from interface:FetchParentAccessRegister a listener to be notified when the parent is "resolved"- Specified by:
registerResolutionListenerin interfaceFetchParentAccess- Overrides:
registerResolutionListenerin classAbstractFetchParentAccess
-
loadInstance
protected static Object loadInstance(EntityKey entityKey, ToOneAttributeMapping referencedModelPart, SharedSessionContractImplementor session)
-
getParentEntityAttribute
protected AttributeMapping getParentEntityAttribute(String attributeName)
-
getFetchParentAccess
public FetchParentAccess getFetchParentAccess()
- Specified by:
getFetchParentAccessin interfaceFetchParentAccess
-
getConcreteDescriptor
public EntityPersister getConcreteDescriptor()
- Specified by:
getConcreteDescriptorin interfaceEntityInitializer
-
-