Spring Boot Rest JPA Example



Project Structure : 

Following maven structure used for Spring Boot application .



Following Technologies are used  : 
Java ,Maven,Spring Framework , JPA,mySql  ...etc

We developing this application we are used following jars in Maven.


Spring Boot Main function we will write in the following way.

We are using @SpringBootApplication annotation.




We are using two different types of rest calls.
Rest Calls : Get , Post rest calls are used here




After this RestController we are used following service .





After this service we are used following repository calls.



For all these repository calls we are using following entity(User).




We are using following properties for db connections in spring boot.


Download : 
 You can download this from following URL .

https://drive.google.com/open?id=1rylAdSKfzEVZsmfVbrtqWcPpRFLIqFLJ


Output : 

We can test above out put by using following URL :
Open your browser and enter following url .
In db if user object id if you put at the end of the url ,you will get o/p.

http://localhost:8080/rest/user/1
O/P : {
    "userId": 3,
    "name": "Ramu",
    "gender": "M"
}






0 Response to "Spring Boot Rest JPA Example"

Post a Comment