public class MetamodelGraphWalker extends Object
AssociationVisitationStrategy
which really provide the real functionality of what we do
as we walk.
The visitor will walk the entire metamodel graph (the parts reachable from the given root)!!! It is up to the
provided AssociationVisitationStrategy to tell it when to stop. The walker provides the walking; the strategy
provides the semantics of what happens at certain points. Its really very similar to parsers and how parsing is
generally split between syntax and semantics. Walker walks the syntax (associations, identifiers, etc) and when it
calls out to the strategy the strategy then decides the semantics (literally, the meaning).
The visitor will, however, stop if it sees a "duplicate" AssociationKey. In such a case, the walker would call
AssociationVisitationStrategy.foundCircularAssociation(org.hibernate.persister.walking.spi.AssociationAttributeDefinition)
and stop walking any further down that graph any
further.Constructor and Description |
---|
MetamodelGraphWalker(AssociationVisitationStrategy strategy,
SessionFactoryImplementor factory) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAssociationKey(AssociationKey associationKey)
Add association key to indicate the association is being visited.
|
protected boolean |
isDuplicateAssociationKey(AssociationKey associationKey)
Has an association with the specified key been visited already?
|
static void |
visitCollection(AssociationVisitationStrategy strategy,
CollectionPersister persister)
Entry point into walking the model graph of a collection according to its defined metamodel.
|
static void |
visitEntity(AssociationVisitationStrategy strategy,
EntityPersister persister)
Entry point into walking the model graph of an entity according to its defined metamodel.
|
public MetamodelGraphWalker(AssociationVisitationStrategy strategy, SessionFactoryImplementor factory)
public static void visitEntity(AssociationVisitationStrategy strategy, EntityPersister persister)
strategy
- The semantics strategypersister
- The persister describing the entity to start walking frompublic static void visitCollection(AssociationVisitationStrategy strategy, CollectionPersister persister)
strategy
- The semantics strategypersister
- The persister describing the collection to start walking fromprotected void addAssociationKey(AssociationKey associationKey)
associationKey
- - the association key.WalkingException
- if the association with the specified association key
has already been visited.protected boolean isDuplicateAssociationKey(AssociationKey associationKey)
associationKey
- - the association key.Copyright © 2017 JBoss by Red Hat. All rights reserved.