mirror of https://github.com/apache/openjpa.git
OPENJPA-1485: fix potential classCast exception for StateManagerImpl
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@903964 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4197457c85
commit
54ef07f799
|
@ -162,7 +162,7 @@ public class OpenJPAPersistenceUtil {
|
|||
if (fmds != null && fmds.length > 0) {
|
||||
pcs = addToLoadSet(pcs, sm);
|
||||
for (FieldMetaData fmd : fmds) {
|
||||
if (((StateManagerImpl)sm).requiresFetch(fmd)) {
|
||||
if (requiresFetch(sm, fmd)) {
|
||||
if (!isLoadedField(sm, fmd, pcs)) {
|
||||
isLoaded = false;
|
||||
break;
|
||||
|
@ -178,6 +178,12 @@ public class OpenJPAPersistenceUtil {
|
|||
}
|
||||
return isLoaded ? LoadState.LOADED : LoadState.NOT_LOADED;
|
||||
}
|
||||
|
||||
private static boolean requiresFetch(OpenJPAStateManager sm, FieldMetaData fmd) {
|
||||
if (sm instanceof StateManagerImpl)
|
||||
return ((StateManagerImpl)sm).requiresFetch(fmd);
|
||||
return fmd.isInDefaultFetchGroup();
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if the field is a collection type and it was explicitly
|
||||
|
|
Loading…
Reference in New Issue