Hi,

At 20:24 14.8.2000 -0400, dan o'connor wrote:
>On 14 Aug 00, at 17:14, marc fleury wrote:
>> In the case that the developer supplies a ComplexPK (aggregate of fields),
>> currently, we have no other choice but to rely on the hashCode and equals
>> that it supplies to do our internal EJB cuisine.
>> 
>> does the spec say that you should overwrite hashCode and equals??? I don't
>> think so...
>
>Hi Marc,
>
>Yes it does, in 9.2.9.  We should refuse to deploy an entity with a 
>PK that does not override hashCode and equals.


How do you define a "suitable" implementation of a hashCode() and equals()
methods?  If I have a generic ComplexPK as a superclass that overrides
these two methods, is it suitable enough? Or would I have to override these
methods for all subclasses of generic complexPK class as well?  If not, why
isn't the Object class's implementation of hashCode() and equals()
considered suitable? If yes, why doesn't the spec clearly state that all
complex pk's MUST override these two methods?

-- Juha







Reply via email to