If you are passing the actual String object, dont over-ride,  The default
hashCode() and equals() method will suffice.  If you are wrapping a String
into your own PrimaryKey object, use the String's hashCode().  If you have a
composite primary key, you need to implement both.

ANd how to implement a good hashing algorithm isnt a thread I wanna start
again <g>

Dave Wolf
Internet Applications Division
Sybase

----- Original Message -----
From: "Prince Jacob Alex" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 22, 2000 8:52 AM
Subject: Need help in PK Class


> Hello,
>
>    I am developing some sample EJB's using EJB ver 1.1 and weblogic as
> the container. According to EJB 1.1 spec we need to override the methods
> boolean equals() and int hashcode() in the PK class.
>
>   My doubt is that if my primary key is a String, then how do I override
> the method int hashCode(). I can cast the return as string but that
> dosen't make much of sense.
>
> Please let me know if I am missing something.
>
> Thanks
>
> Prince
>
>
===========================================================================
> 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".

Reply via email to