Added ids to entity and a comparison operator.