HHH-8276 - Integrate LoadPlans into UniqueEntityLoader (PoC)
This commit is contained in:
parent
803c73c555
commit
d6ac5359a7
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue