diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado')
-rw-r--r-- | src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java | 12 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java | 9 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java b/src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java index 53e9d4e..c1119ac 100644 --- a/src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java +++ b/src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java @@ -345,6 +345,18 @@ public @interface DateTimeAdapter { : mDateTimeParser.parseDateTime(isoDateString).toDate();
}
+ public Date adaptToDate(java.sql.Date date) {
+ return date == null ? null : new Date(date.getTime());
+ }
+
+ public Date adaptToDate(Time time) {
+ return time == null ? null : new Date(time.getTime());
+ }
+
+ public Date adaptToDate(Timestamp timestamp) {
+ return timestamp == null ? null : new Date(timestamp.getTime());
+ }
+
// Adapt from Date...
public long adaptToLong(Date date) {
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 fc32e21..27c0b13 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java @@ -722,9 +722,6 @@ public class JDBCStorableIntrospector extends StorableIntrospector { if (desiredClass == java.sql.Date.class) {
actualClass = java.sql.Timestamp.class;
suffix = "Timestamp";
- } else if (desiredClass == String.class) {
- actualClass = String.class;
- suffix = "String";
} else {
return null;
}
@@ -734,9 +731,6 @@ public class JDBCStorableIntrospector extends StorableIntrospector { if (desiredClass == java.sql.Time.class) {
actualClass = java.sql.Time.class;
suffix = "Time";
- } else if (desiredClass == String.class) {
- actualClass = String.class;
- suffix = "String";
} else {
return null;
}
@@ -746,9 +740,6 @@ public class JDBCStorableIntrospector extends StorableIntrospector { if (desiredClass == java.sql.Timestamp.class) {
actualClass = java.sql.Timestamp.class;
suffix = "Timestamp";
- } else if (desiredClass == String.class) {
- actualClass = String.class;
- suffix = "String";
} else {
return null;
}
|