Add setData method to entities.