Added Equals and hashcode to Entity and Relation