summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/adapter
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2007-08-31 02:27:08 +0000
committerBrian S. O'Neill <bronee@gmail.com>2007-08-31 02:27:08 +0000
commit74dca942050240948412851ff2a02965d90a8e35 (patch)
treea6f6a36f4fc70733150d6c565d3bb970c8732114 /src/main/java/com/amazon/carbonado/adapter
parent1a89c8b6e4e558a669c3736e6cb93206d4ace408 (diff)
More fixes for adapting SQL dates.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/adapter')
-rw-r--r--src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java12
1 files changed, 12 insertions, 0 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) {