Top Description Inners Fields Constructors Methods
org.hibernate.loader.plan.build.internal

public abstract Class AbstractLoadPlanBuildingAssociationVisitationStrategy

extends Object
implements LoadPlanBuildingAssociationVisitationStrategy, LoadPlanBuildingContext
Class Inheritance
All Implemented Interfaces
org.hibernate.loader.plan.build.spi.LoadPlanBuildingContext, org.hibernate.loader.plan.build.spi.LoadPlanBuildingAssociationVisitationStrategy, org.hibernate.persister.walking.spi.AssociationVisitationStrategy
Known Direct Subclasses
org.hibernate.loader.plan.build.internal.FetchStyleLoadPlanBuildingAssociationVisitationStrategy, org.hibernate.loader.plan.build.internal.AbstractEntityGraphVisitationStrategy
Imports
java.util.ArrayDeque, .HashMap, .Map, org.hibernate.HibernateException, org.hibernate.engine.FetchStrategy, .FetchStyle, .FetchTiming, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.internal.util.StringHelper, org.hibernate.loader.PropertyPath, org.hibernate.loader.plan.build.internal.returns.CollectionReturnImpl, .EntityReturnImpl, org.hibernate.loader.plan.build.internal.spaces.QuerySpacesImpl, org.hibernate.loader.plan.build.spi.ExpandingEntityIdentifierDescription, .ExpandingFetchSource, .ExpandingQuerySpaces, .LoadPlanBuildingAssociationVisitationStrategy, .LoadPlanBuildingContext, org.hibernate.loader.plan.spi.AttributeFetch, .CollectionAttributeFetch, .CollectionFetchableElement, .CollectionFetchableIndex, .CollectionReference, .CollectionReturn, .CompositeAttributeFetch, .CompositeFetch, .EntityFetch, .EntityReference, .EntityReturn, .FetchSource, .Return, org.hibernate.persister.entity.Joinable, org.hibernate.persister.walking.internal.FetchStrategyHelper, org.hibernate.persister.walking.spi.AnyMappingDefinition, .AssociationAttributeDefinition, .AssociationKey, .AttributeDefinition, .CollectionDefinition, .CollectionElementDefinition, .CollectionIndexDefinition, .CompositionDefinition, .EntityDefinition, .EntityIdentifierDefinition, .WalkingException, org.hibernate.type.Type, org.jboss.logging.Logger, .MDC

A LoadPlanBuildingAssociationVisitationStrategy is a strategy for building a LoadPlan. LoadPlanBuildingAssociationVisitationStrategy is also a AssociationVisitationStrategy, which is used in conjunction with visiting associations via walking metamodel definitions.

So this strategy defines a AssociationVisitationStrategy that walks the metamodel-defined associations after which is can then build a LoadPlan based on the visited associations. determineFetchStrategy is the main decision point that determines if an association is walked.

Author
Steve Ebersole
See Also
org.hibernate.loader.plan.build.spi.LoadPlanBuildingAssociationVisitationStrategy, org.hibernate.persister.walking.spi.AssociationVisitationStrategy

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AbstractLoadPlanBuildingAssociationVisitationStrategy.PropertyPathStack

Maintains stack information for the property paths we are processing for logging purposes.

Field Summary

Modifier and TypeField and Description
private ArrayDeque<CollectionReference>
protected PropertyPath
private Map<AssociationKey, FetchSource>
private final ArrayDeque<ExpandingFetchSource>
private static final Logger
private static final String
private final AbstractLoadPlanBuildingAssociationVisitationStrategy.PropertyPathStack
private final QuerySpacesImpl
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Constructor Summary

AccessConstructor and Description
protected
AbstractLoadPlanBuildingAssociationVisitationStrategy(SessionFactoryImplementor
The session factory.
sessionFactory
)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Constructs an AbstractLoadPlanBuildingAssociationVisitationStrategy.

Method Summary

Modifier and TypeMethod and Description
protected abstract void
addRootReturn(Return rootReturn)

public void
private void
checkedPoppedCollection(CollectionReference poppedCollectionReference, CollectionDefinition collectionDefinition)

private void
private CollectionReference
protected int
protected ExpandingFetchSource
protected abstract FetchStrategy
public void
finish()

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finish.

Notification we are finished visitation.
public void
finishingAttribute(AttributeDefinition
The attribute we are done walking
attributeDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingAttribute.

Notification that we are finishing walking an attribute.
public void
finishingCollection(CollectionDefinition
The collection we are finishing
collectionDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollection.

Notification that we are finishing walking a collection
public void
finishingCollectionElements(CollectionElementDefinition
The collection element we are finishing
elementDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollectionElements.

Notification that we are finishing walking the elements of a collection (List/Map).
public void
finishingCollectionIndex(CollectionIndexDefinition
The collection index we are finishing
indexDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollectionIndex.

Notification that we are finishing walking the index of a collection (List/Map).
public void
finishingComposite(CompositionDefinition
The composite we are finishing
compositionDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingComposite.

Notification that we are done walking a composite.
public void
finishingEntity(EntityDefinition
The entity we are finishing walking.
entityDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingEntity.

Notification we are finishing walking an entity.
public void
finishingEntityIdentifier(EntityIdentifierDefinition
The identifier we are finishing walking.
entityIdentifierDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingEntityIdentifier.

Notification we are finishing walking an entity.
public void
public void
public ExpandingQuerySpaces
public SessionFactoryImplementor
getSessionFactory()

Implements org.hibernate.loader.plan.build.spi.LoadPlanBuildingContext.getSessionFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Access to the SessionFactory
protected boolean
protected boolean
public boolean
protected boolean
private CollectionReference
private ExpandingFetchSource
private void
private void
public FetchSource
protected SessionFactoryImplementor

Returns:

The session factory.
sessionFactory
()

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Gets the session factory.
public void
start()

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.start.

Notification we are preparing to start visitation.
public boolean
startingAttribute(AttributeDefinition
The attribute we are preparing to walk.
attributeDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingAttribute.

Notification that we are preparing to walk an attribute.
public void
startingCollection(CollectionDefinition
The collection we are preparing to walk
collectionDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollection.

Notification that we are starting to walk a collection
public void
startingCollectionElements(CollectionElementDefinition
The collection element we are preparing to walk..
elementDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollectionElements.

Notification that we are starting to look at the element definition for the collection.
public void
startingCollectionIndex(CollectionIndexDefinition
The collection index we are preparing to walk.
indexDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollectionIndex.

Notification that we are starting to walk the index of a collection (List/Map).
public void
startingComposite(CompositionDefinition
The composite we are preparing to walk.
compositionDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingComposite.

Notification that we are preparing to walk a composite.
public void
startingEntity(EntityDefinition
The entity we are preparing to walk
entityDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingEntity.

Notification we are starting to walk an entity.
public void
startingEntityIdentifier(EntityIdentifierDefinition
The identifier we are preparing to walk
entityIdentifierDefinition
)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingEntityIdentifier.

Notification we are starting to walk the identifier of an entity.
protected boolean
protected boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

collectionReferenceStackback to summary
private ArrayDeque<CollectionReference> collectionReferenceStack
currentPropertyPathback to summary
protected PropertyPath currentPropertyPath
fetchedAssociationKeySourceMapback to summary
private Map<AssociationKey, FetchSource> fetchedAssociationKeySourceMap
fetchSourceStackback to summary
private final ArrayDeque<ExpandingFetchSource> fetchSourceStack
logback to summary
private static final Logger log
MDC_KEYback to summary
private static final String MDC_KEY
propertyPathStackback to summary
private final AbstractLoadPlanBuildingAssociationVisitationStrategy.PropertyPathStack propertyPathStack
querySpacesback to summary
private final QuerySpacesImpl querySpaces
sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Constructor Detail

AbstractLoadPlanBuildingAssociationVisitationStrategyback to summary
protected AbstractLoadPlanBuildingAssociationVisitationStrategy(SessionFactoryImplementor sessionFactory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Constructs an AbstractLoadPlanBuildingAssociationVisitationStrategy.

Parameters
sessionFactory:SessionFactoryImplementor

The session factory.

Method Detail

addRootReturnback to summary
protected abstract void addRootReturn(Return rootReturn)
associationKeyRegisteredback to summary
public void associationKeyRegistered(AssociationKey associationKey)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.associationKeyRegistered.

Annotations
@Override
checkedPoppedCollectionback to summary
private void checkedPoppedCollection(CollectionReference poppedCollectionReference, CollectionDefinition collectionDefinition)
checkPoppedEntityback to summary
private void checkPoppedEntity(ExpandingFetchSource fetchSource, EntityDefinition entityDefinition)
currentCollectionback to summary
private CollectionReference currentCollection()
currentDepthback to summary
protected int currentDepth()
currentSourceback to summary
protected ExpandingFetchSource currentSource()
determineFetchStrategyback to summary
protected abstract FetchStrategy determineFetchStrategy(AssociationAttributeDefinition attributeDefinition)
finishback to summary
public void finish()

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finish.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finish.

Notification we are finished visitation.

Annotations
@Override
finishingAttributeback to summary
public void finishingAttribute(AttributeDefinition attributeDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingAttribute.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingAttribute.

Notification that we are finishing walking an attribute.

Parameters
attributeDefinition:AttributeDefinition

The attribute we are done walking

Annotations
@Override
finishingCollectionback to summary
public void finishingCollection(CollectionDefinition collectionDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollection.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollection.

Notification that we are finishing walking a collection

Parameters
collectionDefinition:CollectionDefinition

The collection we are finishing

Annotations
@Override
finishingCollectionElementsback to summary
public void finishingCollectionElements(CollectionElementDefinition elementDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollectionElements.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollectionElements.

Notification that we are finishing walking the elements of a collection (List/Map).

Parameters
elementDefinition:CollectionElementDefinition

The collection element we are finishing

Annotations
@Override
finishingCollectionIndexback to summary
public void finishingCollectionIndex(CollectionIndexDefinition indexDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollectionIndex.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingCollectionIndex.

Notification that we are finishing walking the index of a collection (List/Map).

Parameters
indexDefinition:CollectionIndexDefinition

The collection index we are finishing

Annotations
@Override
finishingCompositeback to summary
public void finishingComposite(CompositionDefinition compositionDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingComposite.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingComposite.

Notification that we are done walking a composite. Called on the back-end of the situations listed on startingComposite

Parameters
compositionDefinition:CompositionDefinition

The composite we are finishing

Annotations
@Override
finishingEntityback to summary
public void finishingEntity(EntityDefinition entityDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingEntity.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingEntity.

Notification we are finishing walking an entity.

Parameters
entityDefinition:EntityDefinition

The entity we are finishing walking.

Annotations
@Override
finishingEntityIdentifierback to summary
public void finishingEntityIdentifier(EntityIdentifierDefinition entityIdentifierDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingEntityIdentifier.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.finishingEntityIdentifier.

Notification we are finishing walking an entity.

Parameters
entityIdentifierDefinition:EntityIdentifierDefinition

The identifier we are finishing walking.

Annotations
@Override
foundAnyback to summary
public void foundAny(AnyMappingDefinition anyDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.foundAny.

Annotations
@Override
foundCircularAssociationback to summary
public void foundCircularAssociation(AssociationAttributeDefinition attributeDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.foundCircularAssociation.

Annotations
@Override
getQuerySpacesback to summary
public ExpandingQuerySpaces getQuerySpaces()

Implements org.hibernate.loader.plan.build.spi.LoadPlanBuildingContext.getQuerySpaces.

Annotations
@Override
getSessionFactoryback to summary
public SessionFactoryImplementor getSessionFactory()

Implements org.hibernate.loader.plan.build.spi.LoadPlanBuildingContext.getSessionFactory.

Doc from org.hibernate.loader.plan.build.spi.LoadPlanBuildingContext.getSessionFactory.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Access to the SessionFactory

Returns:SessionFactoryImplementor

The SessionFactory

Annotations
@Override
handleAssociationAttributeback to summary
protected boolean handleAssociationAttribute(AssociationAttributeDefinition attributeDefinition)
handleCompositeAttributeback to summary
protected boolean handleCompositeAttribute(AttributeDefinition attributeDefinition)
isDuplicateAssociationKeyback to summary
public boolean isDuplicateAssociationKey(AssociationKey associationKey)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.isDuplicateAssociationKey.

Annotations
@Override
isTooManyCollectionsback to summary
protected boolean isTooManyCollections()
popFromCollectionStackback to summary
private CollectionReference popFromCollectionStack()
popFromStackback to summary
private ExpandingFetchSource popFromStack()
pushToCollectionStackback to summary
private void pushToCollectionStack(CollectionReference collectionReference)
pushToStackback to summary
private void pushToStack(ExpandingFetchSource fetchSource)
registeredFetchSourceback to summary
public FetchSource registeredFetchSource(AssociationKey associationKey)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.registeredFetchSource, org.hibernate.loader.plan.build.spi.LoadPlanBuildingContext.registeredFetchSource.

Annotations
@Override
sessionFactoryback to summary
protected SessionFactoryImplementor sessionFactory()

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Gets the session factory.

Returns:SessionFactoryImplementor

The session factory.

startback to summary
public void start()

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.start.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.start.

Notification we are preparing to start visitation.

Annotations
@Override
startingAttributeback to summary
public boolean startingAttribute(AttributeDefinition attributeDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingAttribute.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingAttribute.

Notification that we are preparing to walk an attribute. May be followed by calls to startingEntity (one-to-one, many-to-one), startingComposite, or startingCollection.

Parameters
attributeDefinition:AttributeDefinition

The attribute we are preparing to walk.

Returns:boolean

true if the walking should continue; false if walking should stop.

Annotations
@Override
startingCollectionback to summary
public void startingCollection(CollectionDefinition collectionDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollection.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollection.

Notification that we are starting to walk a collection

Parameters
collectionDefinition:CollectionDefinition

The collection we are preparing to walk

Annotations
@Override
startingCollectionElementsback to summary
public void startingCollectionElements(CollectionElementDefinition elementDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollectionElements.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollectionElements.

Notification 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 to startingEntity

Parameters
elementDefinition:CollectionElementDefinition

The collection element we are preparing to walk..

Annotations
@Override
startingCollectionIndexback to summary
public void startingCollectionIndex(CollectionIndexDefinition indexDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollectionIndex.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingCollectionIndex.

Notification 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 to startingEntity

Parameters
indexDefinition:CollectionIndexDefinition

The collection index we are preparing to walk.

Annotations
@Override
startingCompositeback to summary
public void startingComposite(CompositionDefinition compositionDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingComposite.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingComposite.

Notification that we are preparing to walk a composite. This is called only for:

  • top-level composites for entity attributes. composite entity identifiers do not route through here, see startingEntityIdentifier if you need to hook into walking the top-level cid composite.
  • All forms of nested composite paths
Parameters
compositionDefinition:CompositionDefinition

The composite we are preparing to walk.

Annotations
@Override
startingEntityback to summary
public void startingEntity(EntityDefinition entityDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingEntity.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingEntity.

Notification we are starting to walk an entity.

Parameters
entityDefinition:EntityDefinition

The entity we are preparing to walk

Annotations
@Override
startingEntityIdentifierback to summary
public void startingEntityIdentifier(EntityIdentifierDefinition entityIdentifierDefinition)

Implements org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingEntityIdentifier.

Doc from org.hibernate.persister.walking.spi.AssociationVisitationStrategy.startingEntityIdentifier.

Notification we are starting to walk the identifier of an entity.

Parameters
entityIdentifierDefinition:EntityIdentifierDefinition

The identifier we are preparing to walk

Annotations
@Override
supportsRootCollectionReturnsback to summary
protected boolean supportsRootCollectionReturns()
supportsRootEntityReturnsback to summary
protected boolean supportsRootEntityReturns()
org.hibernate.loader.plan.build.internal back to summary

public Class AbstractLoadPlanBuildingAssociationVisitationStrategy.PropertyPathStack

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.loader.plan.build.internal.AbstractLoadPlanBuildingAssociationVisitationStrategy.PropertyPathStack

Maintains stack information for the property paths we are processing for logging purposes. Because of the recursive calls it is often useful (while debugging) to be able to see the "property path" as part of the logging output.

Field Summary

Modifier and TypeField and Description
private ArrayDeque<PropertyPath>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
public void
pop()

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pathStackback to summary
private ArrayDeque<PropertyPath> pathStack

Constructor Detail

PropertyPathStackback to summary
public PropertyPathStack()

Method Detail

extractFullPathback to summary
private String extractFullPath(PropertyPath path)
popback to summary
public void pop()
pushback to summary
public void push(PropertyPath path)