From 77e7d9737910e0c4ca99a23d95e0b1dada447e9e Mon Sep 17 00:00:00 2001 From: "A. Abram White" Date: Thu, 3 Aug 2006 23:56:32 +0000 Subject: [PATCH] Fetch group fixes. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@428577 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/openjpa/meta/FetchGroup.java | 8 +++++--- .../persistence/AnnotationPersistenceMetaDataParser.java | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FetchGroup.java b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FetchGroup.java index 2407bed63..bae011531 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FetchGroup.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FetchGroup.java @@ -274,9 +274,11 @@ public class FetchGroup { if (_meta != null) { ClassMetaData sup = _meta.getPCSuperclassMetaData(); - FetchGroup supFG = sup.getFetchGroup(_name); - if (supFG != null && supFG.isPostLoad()) - return true; + if (sup != null) { + FetchGroup supFG = sup.getFetchGroup(_name); + if (supFG != null && supFG.isPostLoad()) + return true; + } } if (_includes == null) diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java index 82ac71fba..cb85978ed 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java @@ -884,6 +884,7 @@ public class AnnotationPersistenceMetaDataParser throw new MetaDataException(_loc.get("bad-fg-field", fg.getName(), meta, attr.name())); + field.setInFetchGroup(fg.getName(), true); if (attr.recursionDepth() != Integer.MIN_VALUE) fg.setRecursionDepth(field, attr.recursionDepth()); }