]> source.dussan.org Git - iciql.git/commitdiff
Improve SQL numeric to Java object type conversions
authorJames Moger <james.moger@gitblit.com>
Sat, 1 Nov 2014 15:47:03 +0000 (11:47 -0400)
committerJames Moger <james.moger@gitblit.com>
Sat, 1 Nov 2014 15:47:03 +0000 (11:47 -0400)
src/main/java/com/iciql/util/Utils.java

index 5b2914a8058b61d06f7f5922018806f7a79da520..e542054b0c4ace63fb49504268c8c5f6e3714691 100644 (file)
@@ -307,6 +307,16 @@ public class Utils {
                                return n.doubleValue();\r
                        } else if (targetType == float.class || targetType == Float.class) {\r
                                return n.floatValue();\r
+                       } else if (targetType == BigDecimal.class) {\r
+                               return new BigDecimal(n.doubleValue());\r
+                       } else if (targetType == java.util.Date.class) {\r
+                               return new java.util.Date(n.longValue());\r
+                       } else if (targetType == java.sql.Date.class) {\r
+                               return new java.sql.Date(n.longValue());\r
+                       } else if (targetType == java.sql.Time.class) {\r
+                               return new java.sql.Time(n.longValue());\r
+                       } else if (targetType == java.sql.Timestamp.class) {\r
+                               return new java.sql.Timestamp(n.longValue());\r
                        }\r
                }\r
 \r