public abstract class AbstractEntityGraphVisitationStrategy extends AbstractLoadPlanBuildingAssociationVisitationStrategy
AbstractLoadPlanBuildingAssociationVisitationStrategy.PropertyPathStack
Modifier and Type | Field and Description |
---|---|
protected static FetchStrategy |
DEFAULT_EAGER
The JPA 2.1 SPEC's Entity Graph only defines _WHEN_ to load an attribute, it doesn't define _HOW_ to load it
So I'm here just making an assumption that when it is EAGER, then we use JOIN, and when it is LAZY, then we use SELECT.
|
protected static FetchStrategy |
DEFAULT_LAZY |
protected LoadQueryInfluencers |
loadQueryInfluencers |
currentPropertyPath
Modifier | Constructor and Description |
---|---|
protected |
AbstractEntityGraphVisitationStrategy(SessionFactoryImplementor sessionFactory,
LoadQueryInfluencers loadQueryInfluencers,
LockMode lockMode) |
Modifier and Type | Method and Description |
---|---|
protected void |
addRootReturn(Return rootReturn) |
protected FetchStrategy |
adjustJoinFetchIfNeeded(AssociationAttributeDefinition attributeDefinition,
FetchStrategy fetchStrategy) |
protected Map<String,AttributeNodeImplementor> |
buildAttributeNodeMap()
Build "name" -- "attribute node" map from the current entity graph we're visiting.
|
LoadPlan |
buildLoadPlan()
After visitation is done, build the load plan.
|
protected FetchStrategy |
determineFetchStrategy(AssociationAttributeDefinition attributeDefinition) |
void |
finish()
Notification we are finished visitation.
|
void |
finishingAttribute(AttributeDefinition attributeDefinition)
Notification that we are finishing walking an attribute.
|
void |
finishingCollectionElements(CollectionElementDefinition elementDefinition)
Notification that we are finishing walking the elements of a collection (List/Map).
|
void |
finishingCollectionIndex(CollectionIndexDefinition indexDefinition)
Notification that we are finishing walking the index of a collection (List/Map).
|
void |
finishingEntity(EntityDefinition entityDefinition)
Notification we are finishing walking an entity.
|
void |
foundCircularAssociation(AssociationAttributeDefinition attributeDefinition) |
protected abstract GraphNodeImplementor |
getRootEntityGraph() |
protected abstract FetchStrategy |
resolveImplicitFetchStrategyFromEntityGraph(AssociationAttributeDefinition attributeDefinition) |
void |
start()
Notification we are preparing to start visitation.
|
boolean |
startingAttribute(AttributeDefinition attributeDefinition)
I'm using the NULL-OBJECT pattern here.
|
void |
startingCollectionElements(CollectionElementDefinition elementDefinition)
Notification that we are starting to look at the element definition for the collection.
|
void |
startingCollectionIndex(CollectionIndexDefinition indexDefinition)
Notification that we are starting to walk the index of a collection (List/Map).
|
void |
startingEntity(EntityDefinition entityDefinition)
Notification we are starting to walk an entity.
|
protected boolean |
supportsRootCollectionReturns() |
associationKeyRegistered, currentDepth, currentSource, finishingCollection, finishingComposite, finishingEntityIdentifier, foundAny, getQuerySpaces, getSessionFactory, handleAssociationAttribute, handleCompositeAttribute, isDuplicateAssociationKey, isTooManyCollections, registeredFetchSource, sessionFactory, startingCollection, startingComposite, startingEntityIdentifier, supportsRootEntityReturns
protected static final FetchStrategy DEFAULT_EAGER
protected static final FetchStrategy DEFAULT_LAZY
protected final LoadQueryInfluencers loadQueryInfluencers
protected AbstractEntityGraphVisitationStrategy(SessionFactoryImplementor sessionFactory, LoadQueryInfluencers loadQueryInfluencers, LockMode lockMode)
public void start()
AssociationVisitationStrategy
start
in interface AssociationVisitationStrategy
start
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
public void finish()
AssociationVisitationStrategy
finish
in interface AssociationVisitationStrategy
finish
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
public void startingEntity(EntityDefinition entityDefinition)
AssociationVisitationStrategy
startingEntity
in interface AssociationVisitationStrategy
startingEntity
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
entityDefinition
- The entity we are preparing to walkprotected Map<String,AttributeNodeImplementor> buildAttributeNodeMap()
public void finishingEntity(EntityDefinition entityDefinition)
AssociationVisitationStrategy
finishingEntity
in interface AssociationVisitationStrategy
finishingEntity
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
entityDefinition
- The entity we are finishing walking.public boolean startingAttribute(AttributeDefinition attributeDefinition)
startingAttribute
in interface AssociationVisitationStrategy
startingAttribute
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
attributeDefinition
- The attribute we are preparing to walk.true
if the walking should continue; false
if walking should stop.public void finishingAttribute(AttributeDefinition attributeDefinition)
AssociationVisitationStrategy
finishingAttribute
in interface AssociationVisitationStrategy
finishingAttribute
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
attributeDefinition
- The attribute we are done walkingpublic void startingCollectionElements(CollectionElementDefinition elementDefinition)
AssociationVisitationStrategy
AssociationVisitationStrategy.startingEntity(org.hibernate.persister.walking.spi.EntityDefinition)
startingCollectionElements
in interface AssociationVisitationStrategy
startingCollectionElements
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
elementDefinition
- The collection element we are preparing to walk..public void finishingCollectionElements(CollectionElementDefinition elementDefinition)
AssociationVisitationStrategy
finishingCollectionElements
in interface AssociationVisitationStrategy
finishingCollectionElements
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
elementDefinition
- The collection element we are finishingpublic void startingCollectionIndex(CollectionIndexDefinition indexDefinition)
AssociationVisitationStrategy
AssociationVisitationStrategy.startingEntity(org.hibernate.persister.walking.spi.EntityDefinition)
startingCollectionIndex
in interface AssociationVisitationStrategy
startingCollectionIndex
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
indexDefinition
- The collection index we are preparing to walk.public void finishingCollectionIndex(CollectionIndexDefinition indexDefinition)
AssociationVisitationStrategy
finishingCollectionIndex
in interface AssociationVisitationStrategy
finishingCollectionIndex
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
indexDefinition
- The collection index we are finishingprotected boolean supportsRootCollectionReturns()
supportsRootCollectionReturns
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
protected void addRootReturn(Return rootReturn)
addRootReturn
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
protected FetchStrategy determineFetchStrategy(AssociationAttributeDefinition attributeDefinition)
determineFetchStrategy
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
protected abstract FetchStrategy resolveImplicitFetchStrategyFromEntityGraph(AssociationAttributeDefinition attributeDefinition)
protected FetchStrategy adjustJoinFetchIfNeeded(AssociationAttributeDefinition attributeDefinition, FetchStrategy fetchStrategy)
public LoadPlan buildLoadPlan()
LoadPlanBuildingAssociationVisitationStrategy
protected abstract GraphNodeImplementor getRootEntityGraph()
public void foundCircularAssociation(AssociationAttributeDefinition attributeDefinition)
foundCircularAssociation
in interface AssociationVisitationStrategy
foundCircularAssociation
in class AbstractLoadPlanBuildingAssociationVisitationStrategy
Copyright © 2019 JBoss by Red Hat. All rights reserved.