aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-11-01 11:47:03 -0400
committerJames Moger <james.moger@gitblit.com>2014-11-01 11:47:03 -0400
commit0fc37cfe7db1f3c350d544b23a1a9ac650dc2f64 (patch)
tree7e37afe6bdfb0b844580a17ce6f49fc4c20da95c /src
parentfa57a7684e9d4592aac06057fb2de14ccd0df38a (diff)
downloadiciql-0fc37cfe7db1f3c350d544b23a1a9ac650dc2f64.tar.gz
iciql-0fc37cfe7db1f3c350d544b23a1a9ac650dc2f64.zip
Improve SQL numeric to Java object type conversions
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/iciql/util/Utils.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/com/iciql/util/Utils.java b/src/main/java/com/iciql/util/Utils.java
index 5b2914a..e542054 100644
--- a/src/main/java/com/iciql/util/Utils.java
+++ b/src/main/java/com/iciql/util/Utils.java
@@ -307,6 +307,16 @@ public class Utils {
return n.doubleValue();
} else if (targetType == float.class || targetType == Float.class) {
return n.floatValue();
+ } else if (targetType == BigDecimal.class) {
+ return new BigDecimal(n.doubleValue());
+ } else if (targetType == java.util.Date.class) {
+ return new java.util.Date(n.longValue());
+ } else if (targetType == java.sql.Date.class) {
+ return new java.sql.Date(n.longValue());
+ } else if (targetType == java.sql.Time.class) {
+ return new java.sql.Time(n.longValue());
+ } else if (targetType == java.sql.Timestamp.class) {
+ return new java.sql.Timestamp(n.longValue());
}
}