Hibernate Reactive with Panache¶
Use the rest sample to build Quarkus REST endpoints on Hibernate Reactive
with Panache. This module combines a Panache repository, Mutiny types, and a
reactive PostgreSQL client.
Sample structure¶
The module's POM includes quarkus-hibernate-reactive,
quarkus-reactive-pg-client, and quarkus-hibernate-reactive-panache.
PostRepository
implements PanacheRepositoryBase<Post, UUID>. Its query methods return
Mutiny Uni values, and
PostResources
maps them to HTTP responses.
The active datasource kind is PostgreSQL. The sample does not set a URL;
configure one or let Dev Services start a database. Hibernate schema
generation uses drop-and-create, so use a disposable database.
Run the sample¶
From the rest directory, run:
./mvnw quarkus:dev
On Windows, run mvnw.cmd quarkus:dev. The API uses /posts. The
getting-started recipe shows a
create request and test command.
What's next¶
- Compare the direct session API in Hibernate Reactive with the session API.
- See Reactive PostgreSQL Client for SQL without an ORM.