From 40c41de1e897b5167384230574ac96ea002ef8ac Mon Sep 17 00:00:00 2001 From: Archit Jain Date: Tue, 20 May 2014 03:52:26 +0530 Subject: Fix to select right datatype if DECIMAL_DIGITS for a column is less than 0 for a oracle database. --- .../com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo') diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java index 423861d..f609483 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java @@ -754,14 +754,14 @@ public class JDBCStorableIntrospector extends StorableIntrospector { case NUMERIC: case DECIMAL: if (desiredClass == int.class) { - if (decimalDigits == 0) { + if (decimalDigits <= 0) { actualClass = int.class; suffix = "Int"; } else { return null; } } else if (desiredClass == long.class) { - if (decimalDigits == 0) { + if (decimalDigits <= 0) { actualClass = long.class; suffix = "Long"; } else { @@ -774,14 +774,14 @@ public class JDBCStorableIntrospector extends StorableIntrospector { actualClass = BigDecimal.class; suffix = "BigDecimal"; } else if (desiredClass == short.class) { - if (decimalDigits == 0) { + if (decimalDigits <= 0) { actualClass = short.class; suffix = "Short"; } else { return null; } } else if (desiredClass == byte.class) { - if (decimalDigits == 0) { + if (decimalDigits <= 0) { actualClass = byte.class; suffix = "Byte"; } else { -- cgit v1.2.3