Extracted equals and hashCode on ID for use not only in entities