To add to Rickard's answer, you may someday want to take advantage of write
through caching features of the app server, so even with BMP beans, the
container may be keeping a hashtable of them.
Dave
David Brown
Technical Director, Western Operations
GemStone Systems, Inc.
(760)510-2754
[EMAIL PROTECTED]
www.gemstone.com
-----Original Message-----
From: Rickard �berg [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 21, 2000 4:33 AM
To: [EMAIL PROTECTED]
Subject: Re: Primary key
On Mon, 21 Aug 2000 13:23:48 +0200, Jon Finanger
<[EMAIL PROTECTED]> wrote:
>> >Is it neccesary to compute the hashCode() in BMP?
>>
>> Yes. Primary key classes must always implement both hashCode and equals.
>
>Whats the reason for that?
>I was a kind of thinking that this was a special case/most useful for
>CMP....
The reason is that EJB containers use this internally to maintain
hashtables where the pk is used as key and the instances are the values.
Without the bean developer telling how identity is defined, there is no
way to do that.
/Rickard
--
Rickard �berg
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.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".