From 94238f0157f0eecbbd2675b6ff1fb22b9c5c4e2c Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Thu, 9 May 2013 14:58:27 +0200 Subject: [PATCH] [#2450] Cannot set precision on TINYINT, SMALLINT, INT, BIGINT data types --- .../java/org/jooq/impl/DefaultDataType.java | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java index eca269949f..c61fd09e73 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java @@ -66,10 +66,6 @@ import org.jooq.UDTRecord; import org.jooq.exception.SQLDialectNotSupportedException; import org.jooq.tools.Convert; import org.jooq.types.Interval; -import org.jooq.types.UByte; -import org.jooq.types.UInteger; -import org.jooq.types.ULong; -import org.jooq.types.UShort; /** * A common base class for data types. @@ -233,23 +229,7 @@ public class DefaultDataType implements DataType { this.castTypeName = castTypeName; this.castTypeBase = TYPE_NAME_PATTERN.matcher(castTypeName).replaceAll("").trim(); this.arrayType = (Class) Array.newInstance(type, 0).getClass(); - - if (type == Long.class || type == ULong.class) { - this.precision = LONG_PRECISION; - } - else if (type == Integer.class || type == UInteger.class) { - this.precision = INTEGER_PRECISION; - } - else if (type == Short.class || type == UShort.class) { - this.precision = SHORT_PRECISION; - } - else if (type == Byte.class || type == UByte.class) { - this.precision = BYTE_PRECISION; - } - else { - this.precision = precision; - } - + this.precision = precision; this.scale = scale; this.length = length; @@ -305,7 +285,7 @@ public class DefaultDataType implements DataType { @Override public final boolean hasPrecision() { - return type == BigInteger.class || type == BigDecimal.class; + return isNumeric() || isDateTime(); } @Override