Changed the model to make use of the entity class