Override equals and hashcode methods for entity