HHH-7841 - Redesign Loader
This commit is contained in:
parent
63093dbfd9
commit
8c7dfc9d28
|
@ -113,7 +113,15 @@ public class MetadataDrivenModelGraphVisitor {
|
||||||
final PropertyPath subPath = currentPropertyPath.append( attributeDefinition.getName() );
|
final PropertyPath subPath = currentPropertyPath.append( attributeDefinition.getName() );
|
||||||
log.debug( "Visiting attribute path : " + subPath.getFullPath() );
|
log.debug( "Visiting attribute path : " + subPath.getFullPath() );
|
||||||
|
|
||||||
final boolean continueWalk = strategy.startingAttribute( attributeDefinition );
|
final boolean continueWalk;
|
||||||
|
if ( attributeDefinition.getType().isAssociationType() ) {
|
||||||
|
continueWalk =
|
||||||
|
! isDuplicateAssociation( ( (AssociationAttributeDefinition) attributeDefinition ).getAssociationKey() ) &&
|
||||||
|
strategy.startingAttribute( attributeDefinition );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
continueWalk = strategy.startingAttribute( attributeDefinition );
|
||||||
|
}
|
||||||
if ( continueWalk ) {
|
if ( continueWalk ) {
|
||||||
final PropertyPath old = currentPropertyPath;
|
final PropertyPath old = currentPropertyPath;
|
||||||
currentPropertyPath = subPath;
|
currentPropertyPath = subPath;
|
||||||
|
@ -135,11 +143,6 @@ public class MetadataDrivenModelGraphVisitor {
|
||||||
private void visitAssociation(AssociationAttributeDefinition attribute) {
|
private void visitAssociation(AssociationAttributeDefinition attribute) {
|
||||||
// todo : do "too deep" checks; but see note about adding depth to PropertyPath
|
// todo : do "too deep" checks; but see note about adding depth to PropertyPath
|
||||||
|
|
||||||
if ( isDuplicateAssociation( attribute.getAssociationKey() ) ) {
|
|
||||||
log.debug( "Property path deemed to be circular : " + currentPropertyPath.getFullPath() );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( attribute.isCollection() ) {
|
if ( attribute.isCollection() ) {
|
||||||
visitCollectionDefinition( attribute.toCollectionDefinition() );
|
visitCollectionDefinition( attribute.toCollectionDefinition() );
|
||||||
}
|
}
|
||||||
|
@ -210,7 +213,14 @@ public class MetadataDrivenModelGraphVisitor {
|
||||||
private final Set<AssociationKey> visitedAssociationKeys = new HashSet<AssociationKey>();
|
private final Set<AssociationKey> visitedAssociationKeys = new HashSet<AssociationKey>();
|
||||||
|
|
||||||
protected boolean isDuplicateAssociation(AssociationKey associationKey) {
|
protected boolean isDuplicateAssociation(AssociationKey associationKey) {
|
||||||
return !visitedAssociationKeys.add( associationKey );
|
boolean isDuplicate = !visitedAssociationKeys.add( associationKey );
|
||||||
|
if ( isDuplicate ) {
|
||||||
|
log.debug( "Property path deemed to be circular : " + currentPropertyPath.getFullPath() );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class EntityBasedAssociationAttribute
|
||||||
lhsColumnNames = collectionPersister.getElementColumnNames();
|
lhsColumnNames = collectionPersister.getElementColumnNames();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
final OuterJoinLoadable entityPersister = (OuterJoinLoadable) joinable;
|
final OuterJoinLoadable entityPersister = (OuterJoinLoadable) source();
|
||||||
lhsTableName = getLHSTableName( type, attributeNumber(), entityPersister );
|
lhsTableName = getLHSTableName( type, attributeNumber(), entityPersister );
|
||||||
lhsColumnNames = getLHSColumnNames( type, attributeNumber(), entityPersister, sessionFactory() );
|
lhsColumnNames = getLHSColumnNames( type, attributeNumber(), entityPersister, sessionFactory() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue