RE: OT: equals method for persistent objects

2006-04-06 Thread Rob Dennett
anged while the Bar instance was detached. Is there a Best Practice for dealing with this case? Thanks for your help, Rob -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 05, 2006 4:38 PM To: Tapestry users Subject: Re: OT: equals method for per

Re: OT: equals method for persistent objects

2006-04-05 Thread Jesse Kuhnert
Have one really simple part of your equals method that compares db id's, and if one of them isn't set, alternatively compare whatever else is available. (not ~everything~, just enough to give you uniqueness, if that's possible :) ) On 4/5/06, Rob Dennett <[EMAIL PROTECTED]> wrote: > > The Hibernat

OT: equals method for persistent objects

2006-04-05 Thread Rob Dennett
The Hibernate documentation recommends implementing equals and hashCode using an objects business key rather than the database id. Kent Tong in his excellent book _Enjoying Web Development with Tapestry_ implements equals using all fields of his example object, including the field which contain