db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giulio Vezzelli" <giulio.vezze...@infolog.it>
Subject R: Torque BaseObjects' sons have wrong hashCodes ?!
Date Tue, 16 Mar 2004 13:33:06 GMT
> > I'm trying to use hashCode() to identify business objects 
> generated by 
> > Torque...
> 
> Why?

To identify each instance of each object...
I have to check some actions in a web application aren't repeated by using
the "Back" button on the browser.

> > When the object is instantiated as a New User(), if I check 
> hashCode() 
> > immediately after instantiation the integer returned is different 
> > every time I call hashCode() !!!
> 
> I don't know how it's generated, but perhaps it uses values 
> in the fields and when empty... does something else?

I found why... It returns hashCode from a "new SimpleKey" object, which, of
course, is always different.
This doesn't happen when the key is not empty...

I'll use some other method...

Bye

Giulio Vezzelli
Infolog S.r.l.
Via Alfieri, 28
Modena - 41100
Telefono : +39-059-822446
Sito web : http://www.infolog.it
E-mail : giulio.vezzelli@infolog.it
 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message