You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by dj...@apache.org on 2011/06/18 07:00:54 UTC

svn commit: r1137123 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java

Author: djencks
Date: Sat Jun 18 05:00:53 2011
New Revision: 1137123

URL: http://svn.apache.org/viewvc?rev=1137123&view=rev
Log:
OPENEJB-1599 orm generator should ignore synthetic fields

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java?rev=1137123&r1=1137122&r2=1137123&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java Sat Jun 18 05:00:53 2011
@@ -990,15 +990,17 @@ public class CmpJpaConversion implements
             // class in the hierarchy. 
             MappedSuperclass superclass = new MappedSuperclass(clazz.getName());
             for (java.lang.reflect.Field field : clazz.getDeclaredFields()) {
-                String fieldName = field.getName();
-                // if this is one of bean's persistence fields, create the mapping 
-                if (persistantFields.contains(fieldName)) {
-                    fields.put(fieldName, superclass);
-                    persistantFields.remove(fieldName);
-                } else if (!ENHANCED_FIELDS.contains(fieldName)){
-                    // these are fields we need to identify as transient for the persistence engine. 
-                    Transient transientField = new Transient(fieldName);
-                    superclass.addField(transientField);
+                if (!field.isSynthetic()) {
+                    String fieldName = field.getName();
+                    // if this is one of bean's persistence fields, create the mapping
+                    if (persistantFields.contains(fieldName)) {
+                        fields.put(fieldName, superclass);
+                        persistantFields.remove(fieldName);
+                    } else if (!ENHANCED_FIELDS.contains(fieldName)){
+                        // these are fields we need to identify as transient for the persistence engine.
+                        Transient transientField = new Transient(fieldName);
+                        superclass.addField(transientField);
+                    }
                 }
             }
             clazz = clazz.getSuperclass();