compare 2 entities based on their attributes