HHH-8276 - Integrate LoadPlans into UniqueEntityLoader (PoC)

This commit is contained in:
Gail Badner 2013-09-04 13:49:57 -07:00 committed by Steve Ebersole
parent 803c73c555
commit d6ac5359a7
5 changed files with 18 additions and 1 deletions

View File

@ -416,6 +416,11 @@ public abstract class AbstractLoadPlanBuilderStrategy implements LoadPlanBuilder
private Map<AssociationKey,FetchOwner> fetchedAssociationKeyOwnerMap = new HashMap<AssociationKey, FetchOwner>(); private Map<AssociationKey,FetchOwner> fetchedAssociationKeyOwnerMap = new HashMap<AssociationKey, FetchOwner>();
@Override
public boolean isDuplicateAssociationKey(AssociationKey associationKey) {
return fetchedAssociationKeyOwnerMap.containsKey( associationKey );
}
@Override @Override
public void associationKeyRegistered(AssociationKey associationKey) { public void associationKeyRegistered(AssociationKey associationKey) {
// todo : use this information to maintain a map of AssociationKey->FetchOwner mappings (associationKey + current fetchOwner stack entry) // todo : use this information to maintain a map of AssociationKey->FetchOwner mappings (associationKey + current fetchOwner stack entry)

View File

@ -553,6 +553,11 @@ public abstract class AbstractLoadPlanBuildingAssociationVisitationStrategy
private Map<AssociationKey,FetchSource> fetchedAssociationKeySourceMap = new HashMap<AssociationKey, FetchSource>(); private Map<AssociationKey,FetchSource> fetchedAssociationKeySourceMap = new HashMap<AssociationKey, FetchSource>();
@Override
public boolean isDuplicateAssociationKey(AssociationKey associationKey) {
return fetchedAssociationKeySourceMap.containsKey( associationKey );
}
@Override @Override
public void associationKeyRegistered(AssociationKey associationKey) { public void associationKeyRegistered(AssociationKey associationKey) {
// todo : use this information to maintain a map of AssociationKey->FetchSource mappings (associationKey + current FetchSource stack entry) // todo : use this information to maintain a map of AssociationKey->FetchSource mappings (associationKey + current FetchSource stack entry)

View File

@ -170,4 +170,6 @@ public interface AssociationVisitationStrategy {
public void associationKeyRegistered(AssociationKey associationKey); public void associationKeyRegistered(AssociationKey associationKey);
public FetchSource registeredFetchSource(AssociationKey associationKey); public FetchSource registeredFetchSource(AssociationKey associationKey);
public void foundCircularAssociation(AssociationAttributeDefinition attributeDefinition); public void foundCircularAssociation(AssociationAttributeDefinition attributeDefinition);
public boolean isDuplicateAssociationKey(AssociationKey associationKey);
} }

View File

@ -291,6 +291,6 @@ public class MetamodelGraphWalker {
* false, otherwise. * false, otherwise.
*/ */
protected boolean isDuplicateAssociationKey(AssociationKey associationKey) { protected boolean isDuplicateAssociationKey(AssociationKey associationKey) {
return visitedAssociationKeys.contains( associationKey ); return visitedAssociationKeys.contains( associationKey ) || strategy.isDuplicateAssociationKey( associationKey );
} }
} }

View File

@ -263,4 +263,9 @@ public class LoggingAssociationVisitationStrategy implements AssociationVisitati
); );
} }
@Override
public boolean isDuplicateAssociationKey(AssociationKey associationKey) {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
} }