类 AbstractEntityGraphVisitationStrategy
- java.lang.Object
-
- org.hibernate.loader.plan.build.internal.AbstractLoadPlanBuildingAssociationVisitationStrategy
-
- org.hibernate.loader.plan.build.internal.AbstractEntityGraphVisitationStrategy
-
- 所有已实现的接口:
LoadPlanBuildingAssociationVisitationStrategy,LoadPlanBuildingContext,AssociationVisitationStrategy
public abstract class AbstractEntityGraphVisitationStrategy extends AbstractLoadPlanBuildingAssociationVisitationStrategy
Abstract strategy of building loadplan based on entity graph. The problem we're resolving here is, we have TWO trees to walk (only entity loading here):- entity metadata and its associations
- entity graph and attribute nodes
- 作者:
- Strong Liu
, Brett Meyer
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.hibernate.loader.plan.build.internal.AbstractLoadPlanBuildingAssociationVisitationStrategy
AbstractLoadPlanBuildingAssociationVisitationStrategy.PropertyPathStack
-
-
字段概要
字段 修饰符和类型 字段 说明 protected static FetchStrategyDEFAULT_EAGERThe 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 FetchStrategyDEFAULT_LAZYprotected LoadQueryInfluencersloadQueryInfluencers-
从类继承的字段 org.hibernate.loader.plan.build.internal.AbstractLoadPlanBuildingAssociationVisitationStrategy
currentPropertyPath
-
-
构造器概要
构造器 限定符 构造器 说明 protectedAbstractEntityGraphVisitationStrategy(SessionFactoryImplementor sessionFactory, LoadQueryInfluencers loadQueryInfluencers, LockMode lockMode)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected voidaddRootReturn(Return rootReturn)protected FetchStrategyadjustJoinFetchIfNeeded(AssociationAttributeDefinition attributeDefinition, FetchStrategy fetchStrategy)LoadPlanbuildLoadPlan()After visitation is done, build the load plan.protected FetchStrategydetermineFetchStrategy(AssociationAttributeDefinition attributeDefinition)voidfinish()Notification we are finished visitation.voidfinishingAttribute(AttributeDefinition attributeDefinition)Notification that we are finishing walking an attribute.voidfinishingCollectionElements(CollectionElementDefinition elementDefinition)Notification that we are finishing walking the elements of a collection (List/Map).voidfinishingCollectionIndex(CollectionIndexDefinition indexDefinition)Notification that we are finishing walking the index of a collection (List/Map).voidfoundCircularAssociation(AssociationAttributeDefinition attributeDefinition)protected abstract GraphImplementorgetRootEntityGraph()protected abstract FetchStrategyresolveImplicitFetchStrategyFromEntityGraph(AssociationAttributeDefinition attributeDefinition)voidstart()Notification we are preparing to start visitation.booleanstartingAttribute(AttributeDefinition attributeDefinition)I'm using the NULL-OBJECT pattern here.voidstartingCollectionElements(CollectionElementDefinition elementDefinition)Notification that we are starting to look at the element definition for the collection.voidstartingCollectionIndex(CollectionIndexDefinition indexDefinition)Notification that we are starting to walk the index of a collection (List/Map).protected booleansupportsRootCollectionReturns()-
从类继承的方法 org.hibernate.loader.plan.build.internal.AbstractLoadPlanBuildingAssociationVisitationStrategy
associationKeyRegistered, currentDepth, currentSource, finishingCollection, finishingComposite, finishingEntity, finishingEntityIdentifier, foundAny, getQuerySpaces, getSessionFactory, handleAssociationAttribute, handleCompositeAttribute, isDuplicateAssociationKey, isTooManyCollections, registeredFetchSource, sessionFactory, startingCollection, startingComposite, startingEntity, startingEntityIdentifier, supportsRootEntityReturns
-
-
-
-
字段详细资料
-
DEFAULT_EAGER
protected static final 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. NOTE: this may be changed in the near further, though ATM I have no idea how this will be changed to :) -- stliu
-
DEFAULT_LAZY
protected static final FetchStrategy DEFAULT_LAZY
-
loadQueryInfluencers
protected final LoadQueryInfluencers loadQueryInfluencers
-
-
构造器详细资料
-
AbstractEntityGraphVisitationStrategy
protected AbstractEntityGraphVisitationStrategy(SessionFactoryImplementor sessionFactory, LoadQueryInfluencers loadQueryInfluencers, LockMode lockMode)
-
-
方法详细资料
-
start
public void start()
从接口复制的说明:AssociationVisitationStrategyNotification we are preparing to start visitation.
-
finish
public void finish()
从接口复制的说明:AssociationVisitationStrategyNotification we are finished visitation.
-
startingAttribute
public boolean startingAttribute(AttributeDefinition attributeDefinition)
I'm using the NULL-OBJECT pattern here. For attributes that don't exist in the EntityGraph, a predefined NULL-ATTRIBUTE-NODE is pushed to the stack. And for a nonexistent subgraph, a predefined NULL-SUBGRAPH is pushed to the stack. So, whenever we start visiting an attribute, there will be an attribute node pushed to the attribute stack, and a subgraph node pushed to the graph stack. when we finish visiting an attribute, these two will be popped from each stack.- 指定者:
startingAttribute在接口中AssociationVisitationStrategy- 覆盖:
startingAttribute在类中AbstractLoadPlanBuildingAssociationVisitationStrategy- 参数:
attributeDefinition- The attribute we are preparing to walk.- 返回:
trueif the walking should continue;falseif walking should stop.
-
finishingAttribute
public void finishingAttribute(AttributeDefinition attributeDefinition)
从接口复制的说明:AssociationVisitationStrategyNotification that we are finishing walking an attribute.- 指定者:
finishingAttribute在接口中AssociationVisitationStrategy- 覆盖:
finishingAttribute在类中AbstractLoadPlanBuildingAssociationVisitationStrategy- 参数:
attributeDefinition- The attribute we are done walking
-
startingCollectionElements
public void startingCollectionElements(CollectionElementDefinition elementDefinition)
从接口复制的说明:AssociationVisitationStrategyNotification that we are starting to look at the element definition for the collection. If the collection elements are entities this will be followed up by a call toAssociationVisitationStrategy.startingEntity(org.hibernate.persister.walking.spi.EntityDefinition)- 指定者:
startingCollectionElements在接口中AssociationVisitationStrategy- 覆盖:
startingCollectionElements在类中AbstractLoadPlanBuildingAssociationVisitationStrategy- 参数:
elementDefinition- The collection element we are preparing to walk..
-
finishingCollectionElements
public void finishingCollectionElements(CollectionElementDefinition elementDefinition)
从接口复制的说明:AssociationVisitationStrategyNotification that we are finishing walking the elements of a collection (List/Map).- 指定者:
finishingCollectionElements在接口中AssociationVisitationStrategy- 覆盖:
finishingCollectionElements在类中AbstractLoadPlanBuildingAssociationVisitationStrategy- 参数:
elementDefinition- The collection element we are finishing
-
startingCollectionIndex
public void startingCollectionIndex(CollectionIndexDefinition indexDefinition)
从接口复制的说明:AssociationVisitationStrategyNotification that we are starting to walk the index of a collection (List/Map). In the case of a Map, if the indices (the keys) are entities this will be followed up by a call toAssociationVisitationStrategy.startingEntity(org.hibernate.persister.walking.spi.EntityDefinition)- 指定者:
startingCollectionIndex在接口中AssociationVisitationStrategy- 覆盖:
startingCollectionIndex在类中AbstractLoadPlanBuildingAssociationVisitationStrategy- 参数:
indexDefinition- The collection index we are preparing to walk.
-
finishingCollectionIndex
public void finishingCollectionIndex(CollectionIndexDefinition indexDefinition)
从接口复制的说明:AssociationVisitationStrategyNotification that we are finishing walking the index of a collection (List/Map).- 指定者:
finishingCollectionIndex在接口中AssociationVisitationStrategy- 覆盖:
finishingCollectionIndex在类中AbstractLoadPlanBuildingAssociationVisitationStrategy- 参数:
indexDefinition- The collection index we are finishing
-
supportsRootCollectionReturns
protected boolean supportsRootCollectionReturns()
-
addRootReturn
protected void addRootReturn(Return rootReturn)
-
determineFetchStrategy
protected FetchStrategy determineFetchStrategy(AssociationAttributeDefinition attributeDefinition)
-
resolveImplicitFetchStrategyFromEntityGraph
protected abstract FetchStrategy resolveImplicitFetchStrategyFromEntityGraph(AssociationAttributeDefinition attributeDefinition)
-
adjustJoinFetchIfNeeded
protected FetchStrategy adjustJoinFetchIfNeeded(AssociationAttributeDefinition attributeDefinition, FetchStrategy fetchStrategy)
-
buildLoadPlan
public LoadPlan buildLoadPlan()
After visitation is done, build the load plan.- 返回:
- The load plan
-
getRootEntityGraph
protected abstract GraphImplementor getRootEntityGraph()
-
foundCircularAssociation
public void foundCircularAssociation(AssociationAttributeDefinition attributeDefinition)
-
-