]> source.dussan.org Git - iciql.git/commitdiff
Drop precision and length from SQL->Java type determination
authorJames Moger <james.moger@gitblit.com>
Mon, 17 Nov 2014 22:31:47 +0000 (17:31 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 10 Apr 2015 13:02:04 +0000 (09:02 -0400)
src/main/java/com/iciql/ModelUtils.java

index c3fd8474cab17890fa49df285f16c837b90fdb2a..7fa1de6b688585126840445517f5c0cc54d2a544 100644 (file)
@@ -189,6 +189,10 @@ class ModelUtils {
                sqlType = sqlType.toUpperCase();
                // XXX dropping "UNSIGNED" or parts like that could be trouble
                sqlType = sqlType.split(" ")[0].trim();
+               if (sqlType.indexOf('(') > -1) {
+                       // strip out length or precision
+                       sqlType = sqlType.substring(0, sqlType.indexOf('('));
+               }
 
                if (SQL_TYPES.containsKey(sqlType)) {
                        // convert the sqlType to a standard type