openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fayw...@apache.org
Subject svn commit: r754773 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java
Date Sun, 15 Mar 2009 22:04:03 GMT
Author: faywang
Date: Sun Mar 15 22:04:03 2009
New Revision: 754773

URL: http://svn.apache.org/viewvc?rev=754773&view=rev
Log:
OPENJPA-967: remove duplicate column in the associate
table when MapKey is specified.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java?rev=754773&r1=754772&r2=754773&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/FieldMapping.java
Sun Mar 15 22:04:03 2009
@@ -25,7 +25,6 @@
 import org.apache.openjpa.enhance.Reflection;
 import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.kernel.JDBCStore;
-import org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy;
 import org.apache.openjpa.jdbc.meta.strats.NoneFieldStrategy;
 import org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy;
 import org.apache.openjpa.jdbc.schema.Column;
@@ -53,7 +52,6 @@
 import org.apache.openjpa.util.InternalException;
 import org.apache.openjpa.util.MetaDataException;
 import org.apache.openjpa.util.ObjectId;
-import org.apache.openjpa.util.OpenJPAId;
 
 /**
  * Specialization of metadata for relational databases.
@@ -160,6 +158,14 @@
             if (meta != null)
                 return meta.getTable();
         }
+        
+        ValueMappingImpl vm = (ValueMappingImpl)getDefiningMapping().
+            getEmbeddingMetaData();
+        if (vm != null && vm.getValueMappedBy() != null) {
+            return vm.getFieldMapping().getElementMapping().
+                getDeclaredTypeMapping().getTable();
+        }
+        
         return getDefiningMapping().getTable();
     }
 



Mime
View raw message