ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poitras Christian" <Christian.Poit...@ircm.qc.ca>
Subject RE: database identity (or surrogate key) for equals()
Date Fri, 16 Jun 2006 14:22:57 GMT
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 is not
inserted (like if you call 'new YourClass()'), there is no way to
compare 2 objects...
Maybe you would need some type of comparator for non-inserted objects...


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

I am thinking of using surrogate key (the one generated by
database) to implement equals() of domain object for ibatis. 
Now is there any pitfall I need to know???
Anyone doing things this way??
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.

View raw message