Added hashCode and equals to Entity