Name: ks84122 Date: 04/23/2002
java.sql.Time and java.sql.Date both extend from java.util.Date.
java.util.Date has a compareTo method, that compares the long value.
However, java.sql.Time/java.sql.Date should really be comparing the
time/date components of the long value.
Unfortunately, overriding the compareTo() will break compatibility with previous releases. However, there needs to be a way to compare sql
date and time values.
One of the solutions might be addition of new methods, comparing
time and date respectively.
###@###.### 2002-04-23
Original Description from Borland:
java.sql.Time and java.sql.Date both extend from java.util.Date.
java.util.Date has a compareTo method, that compares the long value.
However a compareTo for java.sql.Time should ignore any date component of the long value such that the range is: [0.00.00-23.59.59].
A compareTo for java.sql.Date should ignore any time component of the long value.
Perhaps both classes should provide an integer number which can be used for the above comparisons. This number could then be used for persistence/serialization.
(Review ID: 145493)
======================================================================