Improved/simplified BaseEntity#hashCode() and equals()