Adding CRUD operations on the REST resource class

In the previous section, we built a very basic RESTful web API by using JAX-RS. In this section, we will enhance this example by introducing more realistic real-life use cases. We will add a department model class to the application and then introduce the REST APIs to perform the CRUD operations on the department object.

We will use the DEPARTMENT table from the HR database schema as the data source for this example. This example uses the Java Persistence API (JPA) for mapping the database table with the Java objects. JPA is a specification for the persistence of Java objects to any relational data store. If you are not familiar with JPA, read the official documentation available at https://docs.oracle.com/javaee/7/tutorial/persistence-intro.htm ...

Get RESTful Java Web Services - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.