Implementing JpaRepository for CRUD capabilities in your Spring Project

Donovan
5 min readFeb 2, 2022

Part 2 in the Full Stack Development Series

In my last tutorial in this series we went over how to connect with your MySQL database. We used the Spring Initializr to create our spring application, created our database, used our spring decorators/annotations to provide metadata about which classes should be used in our database, used the Data Source Explorer to connect our application to our created database, and ran the application to see that our Entity class was being mapped to the database.

In this part we will use a service class and repository interface in order to give our application full CRUD capabilities. CRUD stands for create, read, update, and destroy. These are the four basic operations when talking about persisting data. At the end of the demo your application will have functional methods to be able to do those four operations in your database.

Grab a plate, grab a glass.

You’ll remember from the previous demo we strapped Spring Data JPA to our application giving us access to the Java Persistence Api. This has many tools which can be found here but we just need a few to get our application to have full CRUD capability.

FIRST. We need to understand the flow of our application. Looking ahead in our application…

--

--

Donovan

Learning. Puttin up shots in Angular and Java and Python and anything else I get my hands on. Sights set on becoming a gainfully employed developer.