Spring Data JPA is a library for Spring that helps to integrate a database into your REST API.
In this lesson, we will create an application that will help a botanist keep track of their inventory of plants.
Our database will store information about different plants, how many of them the botanist has, and how often they need to be watered to stay healthy.
Your Spring Boot application will wrap around this database, helping us manage the botanist’s inventory with simple REST calls.
A baseline Spring Boot project has been set up for you. Take a minute to use the editor and file explorer to examine the project and its structure.
To be able to use
spring-boot-starter-data-jpa in your project, you’ll have to add that dependency to your pom.xml, where all the dependencies for the project are kept.
Add the following block underneath the
<dependencies> tag in the pom.xml:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency>