OPENJPA-2536: FetchGroup is not returning lazy fields. Applied Rick Curtis' fix to trunk.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1655360 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Heath Thomann 2015-01-28 15:28:40 +00:00
parent 244e37b189
commit 8129fe685b
2 changed files with 275 additions and 277 deletions

View File

@ -39,6 +39,7 @@ import java.util.TimeZone;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.commons.lang.StringUtils;
import org.apache.openjpa.conf.DetachOptions.FetchGroups;
import org.apache.openjpa.conf.OpenJPAConfiguration;
import org.apache.openjpa.enhance.DynamicPersistenceCapable;
import org.apache.openjpa.enhance.FieldManager;
@ -3209,7 +3210,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
fetch.addFetchGroup(lfg);
lfgAdded = true;
}
} else if (fmd.isInDefaultFetchGroup() && fields == null) {
} else if (fetch.hasFetchGroup(FetchGroup.NAME_DEFAULT) && fmd.isInDefaultFetchGroup() && fields == null) {
// no load group but dfg: add dfg fields if we haven't already
if (!unloadedDFGFieldMarked)
fields = getUnloadedInternal(fetch, LOAD_FGS, null);