The Spring Framework is an application framework and inversion of control container for the Java platform.
The framework's core features can be used by any Java application, but there are extensions for building web
1. Spring Boot is a Spring framework module which provides RAD (Rapid Application Development) feature to the Spring framework.
It is highly dependent on the starter templates feature which is very powerful and works flawlessly.
3. JPA - The Java Persistence API is a Java application programming interface specification that describes
the management of relational data in applications using Java Platform, Standard Edition and Java Platform, Enterprise Edition.
Go to /springbootrestapiexample/src/main/resources/application.properties file and change the following parameters:
spring.datasource.url=
spring.datasource.username=
spring.datasource.password=
Steps to execute this Service and expose the Restful CRUD API for Employees (an example taken to enter Employee records):
I. Right Click on this Git cloned Maven project --> click Run As --> Maven clean (optional, deployment target folder gets removed)
<<---Do your neccessary code changes if any--->>
II. Right Click on this Git cloned Maven project --> click Run As --> Maven build --> (Goals: clean install --> Apply --> Run) needs to be configured for 1st time.
III. springbootrestapiexample --> src/main/java --> com.letsstartcoding.springbootrestapiexample --> Right Click on EmployeeApplication.java --> Click Run As --> Java Application
To insert a particular record: curl -H 'Content-Type: application/json' -X POST -d '{"name":"fjhdkjkj", "designation":"dfadfadf", "expertise":"12"}' http://localhost:8080/company/employees
To fetch all employees data: curl -X GET http://localhost:8080/company/employees
To fetch a particular data: curl -X GET http://localhost:8080/company/notes/1
To update a particular record: curl -H 'Content-Type: application/json' -X PUT -d '{"name":"aadfadf", "designation":"gfdhfdgf", "expertise":"11"}' http://localhost:8080/company/employees/1
To delete a particular record: curl -X DELETE http://localhost:8080/company/employees/1