commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32364] - [lang] HashCodeBuilder failed to generate unique hashcode
Date Tue, 23 Nov 2004 20:21:13 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32364>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32364





------- Additional Comments From bsun@ball.com  2004-11-23 21:21 -------
I just created the simple code so that the problem can be easily reproduced.
The problem actually happened in using OJB to query data from AS400/DB2
database where usually several columns are together used as primary keys.

Thanks.

Bruce
(In reply to comment #1)
> This might be a case where the pattern:
> 
>         return new HashCodeBuilder(17,37).
>                 append(id).
>                 append(name).
>                 toHashCode();
> 
> is not a fit the domain object. If the "id" is unique you can just return the id
> for the hash code. The general case where the id AND the name need to be used as
> a  primary key is going to be a problem for hash codes in general I think since
> we only have the int range.
> 
> Anyone else care to comment please?



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message