Hibernate Reactive
Learn how to use a SQL database with Quarkus and Hibernate Reactive.
We'll cover the following...
Hibernate Reactive is the reactive API for the Hibernate ORM. It adds support for non-blocking database drivers to enable a reactive style of interaction with the database.
Adding the extensions
To use the Hibernate Reactive extension, we need to add a couple of dependencies, the first being the extension itself, called quarkus-hibernate-reactive. The second dependency is the reactive JDBC driver for the chosen database. Quarkus offers a list of extensions to handle different types of databases, which include:
quarkus-reactive-mysql-clientused for MySQL.quarkus-reactive-oracle-clientused for Oracle Database.quarkus-reactive-pg-clientused for PostgreSQL.
Note: In the rest of the course, we’ll use PostgreSQL as the reactive SQL database.
After adding the dependencies, we should have the below new lines in our pom.xml (or build.gradle) file.
Using Hibernate Reactive
Using the Reactive Hibernate API is ...