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 ClassesModifier and TypeClassDescriptionstatic class
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
FieldsFields 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
ConstructorsConstructorDescriptionAbstractBatchEntitySelectFetchInitializer
(InitializerParent<?> parent, ToOneAttributeMapping toOneMapping, NavigablePath fetchedNavigable, EntityPersister concreteDescriptor, DomainResult<?> keyResult, boolean affectedByFilter, AssemblerCreationState creationState) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
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
protected void
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
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 Details
-
owningEntityInitializer
-
-
Constructor Details
-
Method Details
-
registerResolutionListener
-
resolveKey
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
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
-
resolveInstance
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
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>
-
getExistingInitializedInstance
-
registerToBatchFetchQueue
-
initializeInstanceFromParent
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>
-
getParentEntityAttributes
-
getParentEntityAttribute
protected static AttributeMapping getParentEntityAttribute(EntityMappingType subMappingType, ToOneAttributeMapping referencedModelPart, String attributeName)
-