Skip to content

Files

Latest commit

39d81f9 · Dec 7, 2018

History

History
This branch is 9 commits behind payara/Payara-Examples:main.

simple-jpa-example

Simple JPA Example

A simple JPA CRUD example with JAX-RS endpoint

JAX-RS endpoints

CREATE

curl -X POST http://localhost:8080/api/person --header "Content-Type: application/json" -d "{\"name\":\"Gaurav Gupta\", \"address\":\"Lucknow, India\"}"

READ All

curl -X GET  http://localhost:8080/api/person

READ Single

curl -X GET  http://localhost:8080/api/person/1

UPDATE

curl -X PUT http://localhost:8080/api/person --header "Content-Type: application/json" -d "{\"name\":\"Gaurav\", \"id\":1, \"address\":\"Lucknow, India\"}"

DELETE

curl -X DELETE  http://localhost:8080/api/person/1