Moving the restaurant review application to Spring Data

In our next assignment you will be rewriting the restaurant review system you wrote for assignment one. In assignment one you used a combination of DAO classes and the JdbcTemplate class to do all of your database interactions. In this new version of the application you are going to be constructing Hibernate Entity classes for each table in your database and then constructing Spring Data repository interfaces. All of the business logic for your application will migrate to a set of Service classes.

What to do

Start by updating your application to fix any short-comings I identified when I graded your first assignment.

Next, create an Entity class for each table in your database. Pay special attention to relations between entities and implement all of those associations in your entities. For example, Restaurants will contain list of Reviews, Reviews will contain Responses, and so on.

Each Entity will have a corresponding Repository interface. As you work on the business logic for your application you will discover methods that those interfaces will need.

Once you have the entities set up, go to work on writing one or more Service classes to implement the logic of your application. Rewrite your Controller classes to talk to these Service classes.