openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r509674 - /incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
Date Tue, 20 Feb 2007 17:37:22 GMT
Author: awhite
Date: Tue Feb 20 09:37:18 2007
New Revision: 509674

URL: http://svn.apache.org/viewvc?view=rev&rev=509674
Log:
OPENJPA-150 : Re-use parseColumns method when parsing AttributeOverride columns
so that we get secondary table information.  


Modified:
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java?view=diff&rev=509674&r1=509673&r2=509674
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
Tue Feb 20 09:37:18 2007
@@ -378,8 +378,6 @@
     private void parseAttributeOverrides(ClassMapping cm,
         AttributeOverride... attrs) {
         FieldMapping sup;
-        javax.persistence.Column scol;
-        int unique;
         for (AttributeOverride attr : attrs) {
             if (StringUtils.isEmpty(attr.name()))
                 throw new MetaDataException(_loc.get("no-override-name", cm));
@@ -387,13 +385,8 @@
             if (sup == null)
                 sup = (FieldMapping) cm.addDefinedSuperclassField(attr.name(),
                     Object.class, Object.class);
-            scol = attr.column();
-            if (scol == null)
-                continue;
-
-            unique = (scol.unique()) ? TRUE : FALSE;
-            setColumns(sup, sup.getValueInfo(), Arrays.asList
-                (new Column[]{ newColumn(scol) }), unique);
+            if (attr.column() != null)
+                parseColumns(sup, attr.column());
         }
     }
 
@@ -967,20 +960,13 @@
             throw new MetaDataException(_loc.get("not-embedded", fm));
 
         FieldMapping efm;
-        javax.persistence.Column ecol;
-        int unique;
         for (AttributeOverride attr : attrs) {
             efm = embed.getFieldMapping(attr.name());
             if (efm == null)
                 throw new MetaDataException(_loc.get("embed-override-name",
                     fm, attr.name()));
-            ecol = attr.column();
-            if (ecol == null)
-                continue;
-
-            unique = (ecol.unique()) ? TRUE : FALSE;
-            setColumns(efm, efm.getValueInfo(), Arrays.asList
-                (new Column[]{ newColumn(ecol) }), unique);
+            if (attr.column() != null)
+                parseColumns(efm, attr.column());
         }
     }
 



Mime
View raw message