From 24cf4c939e58914168c4e548c25a2c3d977022b7 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Tue, 30 Jan 2007 00:54:19 +0000 Subject: [PATCH] If we don't know the access type for a class when parsing, first check for a superclass and default to that class' access type. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@501255 13f79535-47bb-0310-9956-ffa450edef68 --- .../persistence/XMLPersistenceMetaDataParser.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java index 719abe559..986ad53aa 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java @@ -742,9 +742,17 @@ public class XMLPersistenceMetaDataParser return false; } + // if we don't know the access type, check for a superclass + int defaultAccess = _access; + if (defaultAccess == ClassMetaData.ACCESS_UNKNOWN) { + ClassMetaData sup = repos.getCachedMetaData(_cls.getSuperclass()); + if (sup != null) + defaultAccess = sup.getAccessType(); + } + if (meta == null) { // add metadata for this type - int access = toAccessType(attrs.getValue("access"), _access); + int access = toAccessType(attrs.getValue("access"), defaultAccess); meta = repos.addMetaData(_cls, access); meta.setEnvClassLoader(_envLoader); meta.setSourceMode(MODE_NONE);