There seems to be a problem when inserting into columns of type date into Oracle (9i).
I have an entity Projection with a field of type "date" in schema.xml.
Here is what I do :
Date nowDate = new Date();
nowDate.setTime(System.currentTimeMillis());
Calendar now = new GregorianCalendar();
now.setTime(nowDate);
now.set(Calendar.HOUR_OF_DAY, hourOfDay);
now.set(Calendar.MINUTE, minutes);
now.set(Calendar.SECOND, 0);
now.set(Calendar.MILLISECOND, 0);
Projection proj = new Projection(); ... proj.setPDate(now.getTime()); proj.save();
But the sql query
select to_char(p_date,'DD-MM-YYYY HH24:MI:SS') from projection
shows that only the year-month-day values are stored. The hour-minutes are set to zeros.
I found an issue on this in the list archive dating back to 2002 (here is the url of the thread :
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&by=thread&from=194695 )
but there is no answer solving the problem, and it seems that it hasn't been fixed since then.
The change from date to timestamp in schema.xml does not affect the actual oracle type which is generated (which remains date).
Does anybody have a fix or workaround to this problem ? I would be very gratefull !!
Pierre Henry
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
