svn commit: r881045 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r881045 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java

lektran
Author: lektran
Date: Mon Nov 16 23:27:19 2009
New Revision: 881045

URL: http://svn.apache.org/viewvc?rev=881045&view=rev
Log:
Added java.sql.Date -> java.sql.Timestamp converter

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java?rev=881045&r1=881044&r2=881045&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java Mon Nov 16 23:27:19 2009
@@ -217,6 +217,16 @@
         }
     }
 
+    public static class SqlDateToTimestamp extends AbstractConverter<java.sql.Date, java.sql.Timestamp> {
+        public SqlDateToTimestamp() {
+            super(java.sql.Date.class, java.sql.Timestamp.class);
+        }
+
+        public java.sql.Timestamp convert(java.sql.Date obj) throws ConversionException {
+            return new java.sql.Timestamp(obj.getTime());
+       }
+    }
+
     public static class SqlTimeToString extends GenericLocalizedConverter<java.sql.Time, String> {
         public SqlTimeToString() {
             super(java.sql.Time.class, String.class);