openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r509632 - in /incubator/openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java
Date Tue, 20 Feb 2007 16:33:54 GMT
Author: awhite
Date: Tue Feb 20 08:33:54 2007
New Revision: 509632

URL: http://svn.apache.org/viewvc?view=rev&rev=509632
Log:
OPENJPA-146 : When copying an OID superclass field for re-mapping, revert type
to PC.  It will re-resolve to OID on its own when the field's metadata is
resolved, and in the meantime it will ensure we use the same path for 
metadata resolution as non-copied fields.


Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java?view=diff&rev=509632&r1=509631&r2=509632
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
Tue Feb 20 08:33:54 2007
@@ -888,7 +888,8 @@
      * <ul>
      * <li>Refresh the mappings for given package, without dropping any
      * schema components:<br />
-     * <code>java org.apache.openjpa.jdbc.meta.MappingTool mypackage.jdo</code></li>
+     * <code>java org.apache.openjpa.jdbc.meta.MappingTool 
+     *      mypackage.jdo</code></li>
      * <li>Refresh the mappings for all persistent classes in the classpath,
      * dropping any unused columns and even tables:<br />
      * <code>java org.apache.openjpa.jdbc.meta.MappingTool -sa refresh

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java?view=diff&rev=509632&r1=509631&r2=509632
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueMetaDataImpl.java
Tue Feb 20 08:33:54 2007
@@ -201,8 +201,8 @@
 
         switch (_delete) {
             case CASCADE_NONE:
-                // if the user marks the owning field dependent and we externalize
-                // to a pc type, then become dependent
+                // if the user marks the owning field dependent and we 
+                // externalize to a pc type, then become dependent
                 if (this != _owner.getValue() && isTypePC()
                     && ((ValueMetaDataImpl) _owner.getValue())._delete
                     == CASCADE_AUTO)
@@ -432,8 +432,13 @@
     }
 
     public void copy(ValueMetaData vmd) {
+        // copy declared types, but if OID revert to PC until we resolve
+        // to OID ourselves
         _decType = vmd.getDeclaredType();
         _decCode = vmd.getDeclaredTypeCode();
+        if (_decCode == JavaTypes.OID)
+            _decCode = JavaTypes.PC;
+
         _delete = vmd.getCascadeDelete();
         _persist = vmd.getCascadePersist();
         _attach = vmd.getCascadeAttach();



Mime
View raw message