Equals/hashcode methods fixed

Previously only the ID was used, now all the entity attributes are used.