liveBook · Manning

CRUD

As explained in Quarkus in Action

A CRUD operation is an operation that creates, reads, updates, or deletes a persistent entity.

CRUD names the four operations commonly exposed by a REST API over a persistent database entity: create, read, update, and delete. In Quarkus, REST Data extensions generate JAX-RS resources for Panache entities, reducing repeated endpoint code. section 7.4 section 7.0

A generated CRUD resource typically combines these application pieces:

  • A Panache entity representing the persistent record. section 7.4
  • The quarkus-hibernate-orm-rest-data-panache extension for generated REST operations. section 7.4
  • A database driver such as quarkus-jdbc-postgresql and a JSON serialization extension such as quarkus-rest-jackson. section 7.4
  • An interface extending PanacheEntityResource<Entity, Id>, optionally customized with a root path. section 7.4

Reservation CRUD resource

A ReservationCrudResource interface extending PanacheEntityResource<Reservation, Long> generates REST access for reservations. Applying @ResourceProperties(path = "/admin/reservation") changes its root path, while Swagger UI can display the generated resource. section 7.4

Listing 7.21 Adding REST Data extensions to the Reservation service
$ quarkus ext add quarkus-hibernate-orm-rest-data-panache \
  quarkus-jdbc-postgresql quarkus-rest-jackson
Looking for the newly published extensions in registry.quarkus.io
[SUCCESS] ✅  Extension io.quarkus:quarkus-hibernate-orm-rest-data-panache
 has been installed
 figure  Extension io.quarkus:quarkus-jdbc-postgresql was already installed
 figure  Extension io.quarkus:quarkus-rest-jackson was already installed

The extension command shows the practical setup: install REST Data, confirm the PostgreSQL JDBC driver, and add REST JSON support. section 7.4

How Quarkus in Action covers it

How deep it goes
Reaches extension setup, resource declarations, and path customization but defers broader reactive and NoSQL configurations.
Examples
Demonstrates a Reservation service, generated resource interface, PostgreSQL extension setup, custom root path, and Swagger UI output.
What it assumes
Assumes a database entity and basic Panache familiarity while introducing generated REST access for persistence operations.
What you can do after
Build it from scratch by installing extensions and declaring a Panache-based resource for an entity.
How it connects
Connects REST APIs with Panache, Hibernate ORM, JAX-RS, JDBC, PostgreSQL, MongoDB, and Hibernate Reactive.

Also explained in

Compare how 11 books explain CRUD →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.