Hi All, I am wondering how to write the hashCode() and equals() methods that is mandatory when creating composite @IdClass. Below is the combination of primary @Id keys that I would like to make up in a compound key class: public final class PatientKey implements java.io.Serializable { private String firstnameId; private String SurnameId; private String DateOfBirthID; private String Sex; public int ...
Hi, == checks if the two references are equal and .equlas will check if the value is same, if we want .equals to take care of both reference and value are correct. why cant I just override equals with an extra check that references are equal(==). Please someone elaborate on this and also tell me what role hashcode plays in this. ...