openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r573391 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Date Thu, 06 Sep 2007 21:46:58 GMT
Author: pcl
Date: Thu Sep  6 14:46:57 2007
New Revision: 573391

URL: http://svn.apache.org/viewvc?rev=573391&view=rev
Log:
Removing numeric constant in favor of JDK1.4 literal, now that OpenJPA requires 1.4.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java

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=573391&r1=573390&r2=573391&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
Thu Sep  6 14:46:57 2007
@@ -1532,7 +1532,7 @@
                 return bitTypeName;
             case Types.BLOB:
                 return blobTypeName;
-            case 16: // JDK 1.4 introduces Types.BOOLEAN, whose value is 16
+            case Types.BOOLEAN:
                 return booleanTypeName;
             case Types.CHAR:
                 return charTypeName;
@@ -2518,7 +2518,7 @@
      * @param val the value to cast
      * @param type the type of the case, e.g. {@link Types#NUMERIC}
      */
-    public void appendCast(SQLBuffer buf, FilterValue val, int type) {
+    public void appendCast(SQLBuffer buf, Object val, int type) {
         // Convert the cast function: "CAST({0} AS {1})"
         int firstParam = castFunction.indexOf("{0}");
         String pre = castFunction.substring(0, firstParam); // "CAST("
@@ -2532,7 +2532,12 @@
             post = "";
 
         buf.append(pre);
-        val.appendTo(buf);
+        if (val instanceof FilterValue)
+            ((FilterValue) val).appendTo(buf);
+        else if (val instanceof SQLBuffer)
+            buf.append(((SQLBuffer) val));
+        else
+            buf.append(val.toString());
         buf.append(mid);
         buf.append(getTypeName(type));
         appendLength(buf, type);



Mime
View raw message