openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r1456574 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AnnotationProcessor6.java
Date Thu, 14 Mar 2013 17:57:49 GMT
Author: ppoddar
Date: Thu Mar 14 17:57:48 2013
New Revision: 1456574

URL: http://svn.apache.org/r1456574
Log:
OPENJPA-2305: Revert to previous style of generated metamodel as flattening inherited variables
violate the spec

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

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AnnotationProcessor6.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AnnotationProcessor6.java?rev=1456574&r1=1456573&r2=1456574&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AnnotationProcessor6.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/meta/AnnotationProcessor6.java
Thu Mar 14 17:57:48 2013
@@ -205,7 +205,6 @@ public class AnnotationProcessor6 extend
      */
     @Override
     public boolean process(Set<? extends TypeElement> annos, RoundEnvironment roundEnv)
{
-        System.err.println("Activated " + this.getClass().getName());
         if (active && !roundEnv.processingOver()) {
             Set<? extends Element> elements = roundEnv.getRootElements();
             for (Element e : elements) {
@@ -226,28 +225,25 @@ public class AnnotationProcessor6 extend
     	if (!handler.isAnnotatedAsEntity(e)) {
             return false;
         }
-    	
+
         Elements eUtils = processingEnv.getElementUtils();
         String originalClass = eUtils.getBinaryName((TypeElement) e).toString();
         String originalSimpleClass = e.getSimpleName().toString();
         String metaClass = factory.getMetaModelClassName(originalClass);
-        
+
         SourceCode source = new SourceCode(metaClass);
         comment(source);
         annotate(source, originalClass);
+        TypeElement supCls = handler.getPersistentSupertype(e);
+        if (supCls != null) {
+            String superName = factory.getMetaModelClassName(supCls.toString());
+            source.getTopLevelClass().setSuper(superName);
+        }
         try {
             PrintWriter writer = createSourceFile(originalClass, metaClass, e);
             SourceCode.Class modelClass = source.getTopLevelClass();
-            Set<Element> members = handler.getPersistentMembers(e);
-            TypeElement supCls = handler.getPersistentSupertype(e);
-            if (supCls != null) {
-            	String superName = factory.getMetaModelClassName(supCls.toString());
-            	source.getTopLevelClass().setSuper(superName);
-            }            
-            while (supCls != null) {
-            	members.addAll(handler.getPersistentMembers(supCls));
-                supCls = handler.getPersistentSupertype(supCls);
-            }
+            Set<? extends Element> members = handler.getPersistentMembers(e);
+            
             for (Element m : members) {
                 boolean isPersistentCollection = m.getAnnotation(PersistentCollection.class)
!= null; 
                 



Mime
View raw message