On 6/9/2010 8:49 AM, Adam Heath wrote:
jaco...@apache.org wrote:
Author: jacopoc
Date: Wed Jun  9 13:20:21 2010
New Revision: 952997

URL: http://svn.apache.org/viewvc?rev=952997&view=rev
Log:
Implemented sql date to time converter to avoid errors with Oracle.


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=952997&r1=952996&r2=952997&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
 Wed Jun  9 13:20:21 2010
@@ -305,7 +305,7 @@ public class DateTimeConverters implemen
          }

          public java.sql.Time convert(java.sql.Date obj) throws 
ConversionException {
-            throw new ConversionException("Conversion from Date to Time not 
supported");
+            return new java.sql.Time(obj.getTime());
         }
      }

Huh?  java.sql.Date has no time component, only a date.  The hours,
minutes, seconds, etc are all set to 0.  java.sql.Time has no date,
the day is January 1, 1970.  So, doing this, will give you a Time of 0.

What is the real problem?  This isn't the correct solution.

It boils down to an incompatibility with Oracle and the conversion framework.

I'm working on code to take the conversion framework out of the entity engine - so that will fix this problem and others. I hope to have it working this weekend.

-Adrian

Reply via email to