openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrba...@apache.org
Subject svn commit: r813098 - in /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc: meta/MappingInfo.java schema/Column.java sql/DBDictionary.java sql/OracleDictionary.java
Date Wed, 09 Sep 2009 19:56:38 GMT
Author: jrbauer
Date: Wed Sep  9 19:56:37 2009
New Revision: 813098

URL: http://svn.apache.org/viewvc?rev=813098&view=rev
Log:
OPENJPA-1289 Added Oracle specific type to compatibility checking method.  Added new method
to dictionary to pass in XML indicator.  Updated Oracle dictionary to use it to make LOB determination.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java?rev=813098&r1=813097&r2=813098&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java
Wed Sep  9 19:56:37 2009
@@ -683,7 +683,7 @@
             }
             type =
                 dict.getJDBCType(tmplate.getJavaType(), size == -1, precis,
-                    scale);
+                    scale, tmplate.isXML());
         }
             
         boolean ttype = true;

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java?rev=813098&r1=813097&r2=813098&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Column.java Wed
Sep  9 19:56:37 2009
@@ -642,6 +642,15 @@
                     default:
                         return false;
                 }
+            case 2007:  // Oracle-defined opaque type code for XMLType
+                switch (type) {
+                    case Types.CHAR:
+                    case Types.LONGVARCHAR:
+                    case Types.VARCHAR:
+                        return true;
+                     default:
+                         return false;
+                }
             default:
                 return type == getType();
         }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=813098&r1=813097&r2=813098&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Wed Sep  9 19:56:37 2009
@@ -1491,6 +1491,15 @@
      * {@link JavaTypes} or {@link JavaSQLTypes} constant.
      */
     public int getJDBCType(int metaTypeCode, boolean lob, int precis, 
+        int scale, boolean xml) {
+        return getJDBCType(metaTypeCode, lob, precis, scale);        
+    }
+
+    /**
+     * Return the preferred {@link Types} constant for the given
+     * {@link JavaTypes} or {@link JavaSQLTypes} constant.
+     */
+    public int getJDBCType(int metaTypeCode, boolean lob, int precis, 
         int scale) {
         if (lob) {
             switch (metaTypeCode) {

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=813098&r1=813097&r2=813098&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
Wed Sep  9 19:56:37 2009
@@ -41,6 +41,7 @@
 
 import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
+import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
 import org.apache.openjpa.jdbc.schema.Column;
 import org.apache.openjpa.jdbc.schema.ForeignKey;
 import org.apache.openjpa.jdbc.schema.Index;
@@ -51,6 +52,7 @@
 import org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.meta.JavaTypes;
 import org.apache.openjpa.util.StoreException;
 import org.apache.openjpa.util.UserException;
 
@@ -873,6 +875,17 @@
             sql[0] += " CACHE " + seq.getAllocate();
         return sql;
     }
+    
+    /**
+     * Return the preferred {@link Types} constant for the given
+     * {@link JavaTypes} or {@link JavaSQLTypes} constant.
+     */
+    @Override
+    public int getJDBCType(int metaTypeCode, boolean lob, int precis, 
+        int scale, boolean xml) {        
+        return getJDBCType(metaTypeCode, lob && !xml, precis, scale);        
+    }
+
 
     protected String getSequencesSQL(String schemaName, String sequenceName) {
         StringBuffer buf = new StringBuffer();



Mime
View raw message