RE: When to overwrite equals() and hashCode()

2005-11-10 Thread Cory Prowse
t). -- Cory Prowse -Original Message- From: Thomas Dudziak [mailto:[EMAIL PROTECTED] Sent: Thursday, 10 November 2005 11:39 PM To: OJB Users List; [EMAIL PROTECTED] Subject:Re: When to overwrite equals() and hashCode() On 11/10/05, werner <[EMAIL PROTECTED]> wrote:

Re: When to overwrite equals() and hashCode()

2005-11-10 Thread Thomas Dudziak
On 11/10/05, werner <[EMAIL PROTECTED]> wrote: > Thanks for your answer. The hashCode function is a little mystery to me. > I use a standard database setup where every table has a primary key > (auto increment integer). Is it a proper solution to add the hashcode of > all fields except the primary

Re: When to overwrite equals() and hashCode()

2005-11-10 Thread werner
Am Donnerstag, den 10.11.2005, 11:41 +0100 schrieb Thomas Dudziak: > On 11/10/05, werner <[EMAIL PROTECTED]> wrote: > > > I'm using OJB 1.0.3 with PB-API and it'S doing a great job. Now I'm > > looking for some information about the equals() and hashCode() methods: > > - In which cases should the

Re: When to overwrite equals() and hashCode()

2005-11-10 Thread Thomas Dudziak
On 11/10/05, werner <[EMAIL PROTECTED]> wrote: > I'm using OJB 1.0.3 with PB-API and it'S doing a great job. Now I'm > looking for some information about the equals() and hashCode() methods: > - In which cases should they be overwritten? In general it is a good idea to overwrite these methods bec

When to overwrite equals() and hashCode()

2005-11-10 Thread werner
Hi! I'm using OJB 1.0.3 with PB-API and it'S doing a great job. Now I'm looking for some information about the equals() and hashCode() methods: - In which cases should they be overwritten? - How can hashCode() be implemented? Can I use just the Primary Key for the hashcode, or does that cause pro