summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/repo
diff options
context:
space:
mode:
authorArchit Jain <architj@amazon.com>2014-05-20 03:52:26 +0530
committerArchit Jain <architj@amazon.com>2014-05-20 03:52:26 +0530
commit40c41de1e897b5167384230574ac96ea002ef8ac (patch)
treef783f4cacdedcd342f3688ac6fbc0e8d0740f441 /src/main/java/com/amazon/carbonado/repo
parent623ffa8d9336817fc20cd913b10ce7b11c07ed6c (diff)
Fix to select right datatype if DECIMAL_DIGITS for a column is less than 0 for a oracle database.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java8
1 files changed, 4 insertions, 4 deletions
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 {