ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lamey <cla...@localmatters.com>
Subject Re: How to Compare database record before UPDATE using iBatis?
Date Tue, 31 Mar 2009 16:36:43 GMT
On 3/31/09 7:25 AM, "Nicholoz Koka Kiknadze" <kiknadze@gmail.com> wrote:

> Hm, I usually override equals. Any advantages with hashCode?

Just an FYI, if you override equals(), you should almost always override
hashcode as well.  From the Object.equals Javadoc API:

"Note that it is generally necessary to override the hashCode  method
whenever this method is overridden, so as to maintain the general contract
for the hashCode method, which states that equal objects must have equal
hash codes."

Check out Josh Bloch's "Effective Java" for a detailed explanation.


View raw message