浏览代码

Add lab part 2A

David Ginzberg 7 年前
父节点
当前提交
8934eb309f
共有 1 个文件被更改,包括 33 次插入1 次删除
  1. 33
    1
      README.md

+ 33
- 1
README.md 查看文件

@@ -35,4 +35,36 @@ This time let's find the average, maximum, and minimum IMDB score for movies of
35 35
 
36 36
 That last query isn't very informative for ratings that only have 1 entry. use a `HAVING COUNT(*) > 1` clause to only show ratings with multiple movies showing.
37 37
 
38
-Let's make our movie list more child-friendly. Delete all entries that have a rating of R. Remember to record your query in `script.sql`.
38
+Let's make our movie list more child-friendly. Delete all entries that have a rating of R. Remember to record your query in `script.sql`.
39
+
40
+## Part 2: JDBC
41
+
42
+### 2A: People
43
+
44
+Create a `PersonService` class. These will be used to manipulate the contents of the database given program requirements. Remember to use a `JdbcTemplate` to provide access to your database. All database access logic and sorting/filtering should be handled by your `PersonService` and the SQL queries it issues to the database.
45
+
46
+You can provide your `PersonService` to any controller that needs it by marking it as a `@Service` class and autowiring it into the appropriate controller. Remember that you will also need a corresponding `Person` class to hold the data in transit. You do not need to use any of the JPA annotations (`@ID`, `@Entity` etc.) in your Person class.
47
+
48
+Support the following operations:
49
+
50
+- Add a `Person` to the database
51
+- Update an existing `Person` in the database
52
+- Remove a person from the database
53
+- remove a list of people from the database
54
+- find all people with a particular first name, last name, or birthdate
55
+- Find a single person by ID
56
+- Generate a map of surnames to lists of people with that surname
57
+- Generate a map of first names to the number of times they occur.
58
+
59
+Create the following REST endpoints to interact with the application. You can use postman to confirm your program's behavior.
60
+
61
+ - `POST` `/people` -- create a person
62
+ - `PUT` `/people/{id}` -- update person with `id`. 404 error if that person doesn't exist yet
63
+ - `GET` `/people/{id}` -- get the person with the specified ID
64
+ - `DELETE` `/people/{id}` -- Delete the person with the specified ID
65
+ - `GET` `/people` -- get all people in the database
66
+ - `GET` `/people/reverselookup/{mobileNumber}` -- find all people with the specified mobile number
67
+ - `GET` `/people/surname/{lastName}` -- Find all people with a particular last name
68
+ - `GET` `/people/surname` -- Get the result of the surname report above
69
+ - `GET` `/people/firstname/stats` -- Get the report of first name frequencies
70
+