openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r885526 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Types.java
Date Mon, 30 Nov 2009 18:22:07 GMT
Author: ppoddar
Date: Mon Nov 30 18:22:06 2009
New Revision: 885526

URL: http://svn.apache.org/viewvc?rev=885526&view=rev
Log:
Save NPE on getting super type

Modified:
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Types.java

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Types.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Types.java?rev=885526&r1=885525&r2=885526&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Types.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/Types.java
Mon Nov 30 18:22:06 2009
@@ -136,11 +136,13 @@
          *  Return the identifiable type that corresponds to the most
          *  specific mapped superclass or entity extended by the entity 
          *  or mapped superclass. 
-         *  @return supertype of identifiable type or null if no such supertype
+         *  @return super type of identifiable type or null if no such super type
          */
         public IdentifiableType<? super X> getSupertype() {
-            return (IdentifiableType<? super X>) model.managedType(meta
-                .getPCSuperclassMetaData().getDescribedType());
+            ClassMetaData superMeta = meta.getPCSuperclassMetaData();
+            if (superMeta == null)
+                return null;
+            return (IdentifiableType<? super X>) model.managedType(superMeta.getDescribedType());
         }
 
         public boolean hasIdAttribute() {



Mime
View raw message