use a CRC (Checksum algorithm)...
you can generate one by converting all fields to stringized version of them;
then concatenating them, then using that value to create the hash.
java.util.zip has a couple of classes (Adler32 and CRC32 come to mind) that
will calculate it for you.
HTH
JP Lorandi (a.k.a. Rifle)
-----Original Message-----
From: Thomas Preston [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 29, 2000 12:24 PM
To: [EMAIL PROTECTED]
Subject: hashCode for entity bean with multiple pk columns
Anyone have suggestion regarding standard way to write int hashCode() method
now required in PK when one has multiple PK's.
If I have one PK value (Integer myInteger) I do this:
public int hashCode() {
return myInteger.hashCode();
}
How about if I have two Ingegers and a Timestamp making up my PK, what is a
nice simple clean way to write hashCode method?
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".