Add hasChanged() method to know if the Entity will be inserted or updated in the DB