Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 19531 invoked from network); 16 Jun 2006 14:23:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jun 2006 14:23:20 -0000 Received: (qmail 70286 invoked by uid 500); 16 Jun 2006 14:23:17 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 70267 invoked by uid 500); 16 Jun 2006 14:23:17 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 70256 invoked by uid 99); 16 Jun 2006 14:23:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 07:23:17 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=DNS_FROM_RFC_BOGUSMX,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [207.162.51.5] (HELO pandore.ircm.priv) (207.162.51.5) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 07:23:16 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C69150.5D537EB9" Subject: RE: database identity (or surrogate key) for equals() Date: Fri, 16 Jun 2006 10:22:57 -0400 Message-ID: <5820E7E2A928DB46824297946AC2024A9A5E67@pandore.ircm.priv> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: database identity (or surrogate key) for equals() Thread-Index: AcaRUFUxEQ6uL/0gR8erIqqO1JFgUg== From: "Poitras Christian" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C69150.5D537EB9 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for your comment in hibernate in action. I will read this soon. =20 I guess the worst pitfall may be that as long as your data is not inserted (like if you call 'new YourClass()'), there is no way to compare 2 objects... =20 Maybe you would need some type of comparator for non-inserted objects... ________________________________ From: Dodo [mailto:j2eedodo@gmail.com]=20 Sent: Wednesday, 14 June 2006 21:48 To: user-java@ibatis.apache.org Subject: database identity (or surrogate key) for equals() Hi, =20 I am thinking of using surrogate key (the one generated by database) to implement equals() of domain object for ibatis.=20 =20 Now is there any pitfall I need to know??? =20 Anyone doing things this way?? =20 Although 'Hibernate in Action' said this is a bad idea but I only want to compare objects that have id so I guess this shud be ok. =20 Thanks, =20 Sam ------_=_NextPart_001_01C69150.5D537EB9 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Thanks for your comment in hibernate in action. = I will read this soon.
 
I guess the worst pitfall may be that as long = as your data=20 is not inserted (like if you call 'new YourClass()'), there is no way to = compare=20 2 objects...
 
Maybe you would need some type of comparator = for=20 non-inserted objects...


From: Dodo = [mailto:j2eedodo@gmail.com]=20
Sent: Wednesday, 14 June 2006 21:48
To:=20 user-java@ibatis.apache.org
Subject: database identity (or = surrogate=20 key) for equals()

Hi,
 
I am thinking of using surrogate key = (the one=20 generated by
database) to implement equals() of = domain object=20 for ibatis.
 
Now is there any pitfall I need to=20 know???
 
Anyone doing things this = way??
 
Although 'Hibernate in Action' said = this is a bad=20 idea but
I only want to compare objects that = have id so I=20 guess
this shud be ok.
 
Thanks,
 
Sam
------_=_NextPart_001_01C69150.5D537EB9--