In the previous chapter, we saw how to create a static RESTful API. We will now learn how to manipulate database records as response to an API request. I've used MySQL as a database in this project.
We will use JPA in this project. You can start a new project and add JPA as one of the dependencies. Alternatively, you can add this to your Gradle dependencies list:
compile('org.springframework.boot:spring-boot-starter-data-jpa')
Note: You don't need to put version and artifacts here, it is automatically managed by a Spring Gradle plugin and Spring Boot.
Now, as you added the dependency, you have to add application.properties. Go to resources and add a file named application.properties with the following content:
## Spring DATASOURCE (DataSourceAutoConfiguration &
DataSourceProperties) spring...