David Ginzberg a457fc0bf6 Create README.md il y a 7 ans
.mvn/wrapper first commit il y a 7 ans
src first commit il y a 7 ans
.gitignore first commit il y a 7 ans
README.md Create README.md il y a 7 ans
mvnw first commit il y a 7 ans
mvnw.cmd first commit il y a 7 ans
pom.xml Change application name in pom il y a 7 ans

README.md

CRUDApplication

This repository provides a starter project for a CRUD application using Spring Boot, RestControllers, and H2 for an in memory database. When using the H2 console in the browser (eg: localhost:8080/console) be sure to set the JDBC URL to match the url defined in application-h2.properties. The default is jdbc:h2:mem:testdb.

Exercise

Using this project as a starter, create a Person class as an entity to persist to H2 with an autogenerated id. Provide a RestController for Person with endpoints for HTTP GET, PUT, POST, and DELETE operations mapping to their appropriate CRUD behaviors. Endpoints should be at /person and /person/{id} as appropriate and provide the correct HTTP status codes in the response. See the snippet below for setting Person IDs:

@Entity
public class Person {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    ...
}