This is based on how you consider the uniqueness of this object. If he has a primary key (a unique key), then just use this attribute.
If you think that uniqueness is a combination of 10 different attributes, then use all 10 attributes equally.
Then use only the attributes that you used as equals to generate the hash code, because the same objects must generate the same hash codes.
Choosing attribute (s) for equals and hashcode is how you define the uniqueness of a given object.
Is this a common practice? Yes
Are there any potential issues with this approach? Not
Is there any documentation or recommendations when ignoring some fields in equals / hashCode?
"The equals method for the Object class implements the most discriminatory possible relation of equivalence to objects;
This is from the Javadoc feature class. But as the author of the class, you know how uniqueness is defined.
source share