openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r446720 - /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java
Date Fri, 15 Sep 2006 20:35:21 GMT
Author: mprudhom
Date: Fri Sep 15 13:35:20 2006
New Revision: 446720

URL: http://svn.apache.org/viewvc?view=rev&rev=446720
Log:
Workaround for HSQL bug in treating Long.MAX_VALUE as a double.

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

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java?view=diff&rev=446720&r1=446719&r2=446720
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java
Fri Sep 15 13:35:20 2006
@@ -214,6 +214,18 @@
         return cols;
     }
 
+    public void setDouble(PreparedStatement stmnt, int idx, double val,
+        Column col)
+        throws SQLException {
+        // HSQL has a bug where it cannot store a double if it is
+        // exactly the same as Long.MAX_VALUE or MIN_VALUE
+        if (val == Long.MAX_VALUE || val == Long.MIN_VALUE) {
+            stmnt.setLong(idx, (long)val);
+        } else  {
+            super.setDouble(stmnt, idx, val, col);
+        }
+    }
+
     public void setBigDecimal(PreparedStatement stmnt, int idx, BigDecimal val,
         Column col)
         throws SQLException {



Mime
View raw message