You cannot change those fields to zero without changing the semantics of the instance as you cannot change the timezone to null.
Oh really? ->
To conform with the definition of SQL <code>DATE</code>, the millisecond values wrapped by a <code>java.sql.Date</code> instance must be 'normalized' by setting the hours, minutes, seconds, and milliseconds to zero in the particular time zone with which the instance is associated.
Any guess what I am quoting there? Yep, the JDBC spec. So setting the hours, minutes, seconds and milliseconds of a java.sql.Date to be zero is in fact the expectation set forth by the JDBC spec.
Oracle unfortunately decided to ignore their own spec here. So essentially your argument here is that the Oracle driver is behaving badly here. Ok. So tell me how Hibernate can do the right thing (return Date/Calendar with hours, minutes, seconds and milliseconds set to zero) here against Oracle?
|