Check for field inclusion in fetch group based on names of both decalring and defining class as owner.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@688777 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2008-08-25 16:57:06 +00:00
parent d435a69c6b
commit 00c27c654a
2 changed files with 11 additions and 3 deletions

View File

@ -574,14 +574,14 @@ public class FetchConfigurationImpl
clone._fromField = fm.getFullName(false);
clone._fromType = type;
clone._availableRecursion = getAvailableRecursionDepth(fm, type, true);
if (StringUtils.equals(_directRelationOwner, fm.getFullName()))
if (StringUtils.equals(_directRelationOwner, fm.getFullName(false)))
clone._load = false;
else
clone._load = _load;
FieldMetaData owner = fm.getMappedByMetaData();
if (owner != null && owner.getTypeCode() == JavaTypes.PC)
clone._directRelationOwner = owner.getFullName();
clone._directRelationOwner = owner.getFullName(false);
return clone;
}
@ -593,7 +593,8 @@ public class FetchConfigurationImpl
if (hasFetchGroupAll()
|| (fmd.isInDefaultFetchGroup()
&& hasFetchGroupDefault())
|| hasField(fmd.getFullName(false)))
|| hasField(fmd.getFullName(false))
|| hasField(fmd.getRealName()))
return true;
String[] fgs = fmd.getCustomFetchGroups();
for (int i = 0; i < fgs.length; i++)

View File

@ -349,6 +349,13 @@ public class FieldMetaData
return (embedOwner) ? _embedFullName : _fullName;
}
/**
* The field name, qualified by the defining class.
*/
public String getRealName() {
return getDefiningMetaData().getDescribedType().getName() + "." + _name;
}
/**
* MetaData about the field value.
*/