Workaround for HSQL bug in treating Long.MAX_VALUE as a double.

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@446720 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Marc Prud'hommeaux 2006-09-15 20:35:20 +00:00
parent b2e0133907
commit 65e0a48a81
1 changed files with 12 additions and 0 deletions

View File

@ -214,6 +214,18 @@ public class HSQLDictionary
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 {