On Mon, Jul 30, 2001 at 09:54:50AM +0100, Penhey, Tim wrote:
> All of the debugging was using the objects toString method.  Sometimes the
> debugging for the java.util.Date would show the time (all as zeros) which is
> the toString for the java.util.Date, and sometimes it would just show the
> date, which is the implementation of the java.sql.Date.  
> 
> What appeared to be happening was the java.util.Date was actually a
> java.sql.Date under the covers.  And this somehow was screwing up our
> equality tests.  By changing the underlying field in the bean and the
> primary key to a java.sql.Date instead of a java.util.Date everything then
> worked.

Why didn't you consider to fix your hashcode method? A XOR of all of the
fields' hashcodes should be sufficient:

int hashcode = field1.hashcode() ^ field2.hashcode() ^ datafield.hashcode();

My $0.02,
        -billy.

-- 
Philipp Meier                              o-matic GmbH
Gesch�ftsf�hrer                  Pfarrer-Wei�-Weg 16-18
Tel.: +49-(0)700-66284236                     89077 Ulm

PGP signature

Reply via email to