If the primary key is a composite key having one field of integer type and other of string What will be the hashcode() method in the primary key class? Does concat will do the job?
posted 11 years ago
The standard hashCode method works very well with string objects and it�s really well implemented. On the other hand if you'll concatenate the fields of your pk, you�ll always get a unique string. Returning the hashCode of this string I believe is a pretty acceptable hashing algorithm. Regards.