From: James Moger Date: Mon, 17 Nov 2014 22:31:47 +0000 (-0500) Subject: Drop precision and length from SQL->Java type determination X-Git-Tag: v1.6.0~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ac8eed79c231d951287a8bf23a8334109d5fac44;p=iciql.git Drop precision and length from SQL->Java type determination --- diff --git a/src/main/java/com/iciql/ModelUtils.java b/src/main/java/com/iciql/ModelUtils.java index c3fd847..7fa1de6 100644 --- a/src/main/java/com/iciql/ModelUtils.java +++ b/src/main/java/com/iciql/ModelUtils.java @@ -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