Class AbstractBatchEntitySelectFetchInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
- java.lang.Object
-
- org.hibernate.sql.results.graph.internal.AbstractInitializer<Data>
-
- org.hibernate.sql.results.graph.entity.internal.EntitySelectFetchInitializer<Data>
-
- org.hibernate.sql.results.graph.entity.internal.AbstractBatchEntitySelectFetchInitializer<Data>
-
- All Implemented Interfaces:
EntityInitializer<Data>
,Initializer<Data>
,InitializerParent<Data>
- Direct Known Subclasses:
BatchEntityInsideEmbeddableSelectFetchInitializer
,BatchEntitySelectFetchInitializer
,BatchInitializeEntitySelectFetchInitializer
public abstract class AbstractBatchEntitySelectFetchInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData> extends EntitySelectFetchInitializer<Data> implements EntityInitializer<Data>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData
-
Nested classes/interfaces inherited from class org.hibernate.sql.results.graph.entity.internal.EntitySelectFetchInitializer
EntitySelectFetchInitializer.EntitySelectFetchInitializerData
-
Nested classes/interfaces inherited from interface org.hibernate.sql.results.graph.Initializer
Initializer.State
-
-
Field Summary
Fields Modifier and Type Field Description protected EntityInitializer<InitializerData>
owningEntityInitializer
-
Fields inherited from class org.hibernate.sql.results.graph.entity.internal.EntitySelectFetchInitializer
affectedByFilter, concreteDescriptor, hasLazySubInitializer, keyAssembler, keyIsEager, parent, toOneMapping
-
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 Constructor Description AbstractBatchEntitySelectFetchInitializer(InitializerParent<?> parent, ToOneAttributeMapping toOneMapping, NavigablePath fetchedNavigable, EntityPersister concreteDescriptor, DomainResult<?> keyResult, boolean affectedByFilter, AssemblerCreationState creationState)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Object
getExistingInitializedInstance(Data data)
protected static AttributeMapping
getParentEntityAttribute(EntityMappingType subMappingType, ToOneAttributeMapping referencedModelPart, String attributeName)
protected AttributeMapping[]
getParentEntityAttributes(String attributeName)
void
initializeInstance(Data data)
Step 3 - Initialize the state of the instance resolved inInitializer.resolveInstance(Data)
from the current row values.void
initializeInstanceFromParent(Object parentInstance, Data data)
Step 3.1 - Initialize the state of the instance as extracted from the given parentInstance.protected static Object
loadInstance(EntityKey entityKey, ToOneAttributeMapping toOneMapping, boolean affectedByFilter, SharedSessionContractImplementor session)
protected abstract void
registerResolutionListener(Data data)
protected void
registerToBatchFetchQueue(Data data)
void
resolveInstance(Data 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
resolveInstance(Object instance, Data data)
Step 2.2 - Use the given instance as resolved instance for this initializer.protected void
resolveInstanceFromIdentifier(Data data)
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.-
Methods inherited from class org.hibernate.sql.results.graph.entity.internal.EntitySelectFetchInitializer
createInitializerData, forEachSubInitializer, getConcreteDescriptor, getEntityDescriptor, getEntityIdentifier, getInitializedPart, getKeyAssembler, getNavigablePath, getParent, hasLazySubInitializers, initialize, isEager, isPartOfKey, isResultInitializer, resolveFromPreviousRow, resolveState, 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.entity.EntityInitializer
asEntityInitializer, getConcreteDescriptor, getConcreteDescriptor, getEntityDescriptor, getEntityIdentifier, getEntityIdentifier, getTargetInstance, getTargetInstance, isEntityInitializer, resetResolvedEntityRegistrations, resolveEntityKeyOnly
-
Methods inherited from interface org.hibernate.sql.results.graph.Initializer
asCollectionInitializer, asEmbeddableInitializer, endLoading, endLoading, findOwningEntityInitializer, finishUpRow, finishUpRow, getData, getInitializedPart, getNavigablePath, getParent, getResolvedInstance, getResolvedInstance, hasLazySubInitializers, initializeInstance, initializeInstanceFromParent, isCollectionInitializer, isEager, isEmbeddableInitializer, isLazyCapable, isPartOfKey, isResultInitializer, resolveFromPreviousRow, resolveFromPreviousRow, resolveInstance, resolveInstance, resolveKey, resolveState, resolveState, startLoading
-
-
-
-
Field Detail
-
owningEntityInitializer
protected final EntityInitializer<InitializerData> owningEntityInitializer
-
-
Constructor Detail
-
AbstractBatchEntitySelectFetchInitializer
public AbstractBatchEntitySelectFetchInitializer(InitializerParent<?> parent, ToOneAttributeMapping toOneMapping, NavigablePath fetchedNavigable, EntityPersister concreteDescriptor, DomainResult<?> keyResult, boolean affectedByFilter, AssemblerCreationState creationState)
-
-
Method Detail
-
registerResolutionListener
protected abstract void registerResolutionListener(Data data)
-
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 AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
- Overrides:
resolveKey
in classAbstractInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
-
resolveInstance
public void resolveInstance(Data 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<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
- Overrides:
resolveInstance
in classEntitySelectFetchInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
-
resolveInstanceFromIdentifier
protected void resolveInstanceFromIdentifier(Data data)
-
resolveInstance
public void resolveInstance(Object instance, Data 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<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
- Overrides:
resolveInstance
in classEntitySelectFetchInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
-
initializeInstance
public void initializeInstance(Data 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- Specified by:
initializeInstance
in interfaceInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
- Overrides:
initializeInstance
in classEntitySelectFetchInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
-
registerToBatchFetchQueue
protected void registerToBatchFetchQueue(Data data)
-
initializeInstanceFromParent
public void initializeInstanceFromParent(Object parentInstance, Data data)
Description copied from interface:Initializer
Step 3.1 - Initialize the state of the instance as extracted from the given parentInstance. 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 theJdbcValuesCacheHit
to initialize potentially lazy associations.- Specified by:
initializeInstanceFromParent
in interfaceInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
- Overrides:
initializeInstanceFromParent
in classEntitySelectFetchInitializer<Data extends AbstractBatchEntitySelectFetchInitializer.AbstractBatchEntitySelectFetchInitializerData>
-
loadInstance
protected static Object loadInstance(EntityKey entityKey, ToOneAttributeMapping toOneMapping, boolean affectedByFilter, SharedSessionContractImplementor session)
-
getParentEntityAttributes
protected AttributeMapping[] getParentEntityAttributes(String attributeName)
-
getParentEntityAttribute
protected static AttributeMapping getParentEntityAttribute(EntityMappingType subMappingType, ToOneAttributeMapping referencedModelPart, String attributeName)
-
-