Tutorial about CRUD operations in Spring Boot with Spring Data JPA. Application developed in this tutorial performs adding, editing, updating and deleting contacts.
We will be using the following to successfully create our application in this tutorial:
Go to Spring Initializr and create a Maven project.
Once done, hit Generate Project button to save the project.
Unzip the project and start coding. You can use any editor or IDE you prefer. For Eclipse users, you will have to issue the following command via Terminal before importing to Eclipse:
$ cd springbootcrud
$ mvn eclipse:eclipse
For NetBeans users, just click File > Open Project... or click Open Project toolbar, and locate where you unzipped the project. NetBeans natively suports Maven project, no conversion needed.
Updadte your pom.xml:
Create database in MySQL. Mine is springbootcrud. Add the following table:
Insert the following to application.properties
$ mvn package && java -jar target/springbootcrud-0.0.1.jar
Open your browser and point to: http://localhost:8080
Please post your comments or suggestions.
You can download complete source code here.