liveBook · Manning

Quarkus-hibernate-orm-rest-data-panache

As explained in Quarkus in Action

quarkus-hibernate-orm-rest-data-panache is a Quarkus extension that generates REST resources for Panache entities backed by Hibernate ORM and JDBC.

quarkus-hibernate-orm-rest-data-panache generates JAX-RS REST resources that expose CRUD operations for Panache entities backed by Hibernate ORM and JDBC. It removes repetitive resource code for relational-database APIs. section 7.4

Add the extension alongside the infrastructure required by the generated API:

  • Install quarkus-hibernate-orm-rest-data-panache, a JDBC driver such as quarkus-jdbc-postgresql, and quarkus-rest-jackson for JSON serialization. section 7.4
  • Declare a resource interface extending PanacheEntityResource<Reservation, Long> to generate CRUD endpoints for Reservation entities. section 7.4
  • Customize the generated root path with @ResourceProperties(path = "/admin/reservation"). 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

Use the extension command to add REST Data, JDBC, and REST JSON support to an existing Quarkus service. section 7.4

How Quarkus in Action covers it

How deep it goes
Explains dependencies, resource interfaces, and path customization, but does not detail generated endpoint behavior.
Examples
Demonstrates a ReservationCrudResource interface, PostgreSQL dependencies, a customized admin path, and Swagger UI output.
What it assumes
Assumes Panache entities, Hibernate ORM, JDBC, and REST JSON support; teaches their required extension combination.
What you can do after
Apply it by installing extensions and declaring a typed PanacheEntityResource interface for generated CRUD APIs.
How it connects
Connects Panache entities with Hibernate ORM, JDBC, JAX-RS resources, CRUD operations, and JSON serialization.

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.