David Ginzberg 71f65702cd Update notes on using console | 7 年前 | |
---|---|---|
.mvn/wrapper | 7 年前 | |
src | 7 年前 | |
.gitignore | 7 年前 | |
README.md | 7 年前 | |
mvnw | 7 年前 | |
mvnw.cmd | 7 年前 | |
pom.xml | 7 年前 |
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
.
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. See the snippet below for setting Person IDs:
@Entity
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
...
}