Starter Project

Getting started

Start by clicking the button above to download the starter project for this exam. In the project folder you will find a database folder with database files for the project. Make a new schema named 'registration' in the MySQL workbench and import the database files I provided.

The database has three tables, a table of people, a table of events, and a registrations table. I have already provided some test data in both the people table and the events table. To register a person for an event you will insert a row in the registration table that records the id number of the person registering and the id number of the event they are registering for.

In the starter project I have also provided Person and Event classes as well as PersonRowMapper and EventRowMapper classes. This will save you a little bit of time.

What to do

You are going to build a simple system that manages people, events and registrations. Your application will use the JDBC API and the JdbcTemplate object in your DAO classes to communicate with the database.

Your application will need to implement the following REST methods:

Doing a GET with a URL that ends in /people will return a list of people in the system.

Doing a GET with a URL that ends in /events will return a list of events in the system.

Doing a GET with a URL that ends in /events/<id>/people with <id> replaced by the id of an event returns a list of the people who have registered for that event.

Doing a POST with a URL that ends in /registrations will insert a new registration in the registrations table. The body of the post will specify who is registering and what event they are registering for. For example, to register the person with the id of 4 for the event with id 2 the body of the POST would look like

{"person":4,"event":2}

An attempt to post a duplicate registration should return a status code of 409, CONFLICT.

Turn in your work

When you are done, please submit your work on the course Canvas page.