A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.
Learn more at http://hibernate.org/reactive.
Hibernate Reactive has been tested with:
Support for SQL Server is coming soon.
The Introduction to Hibernate Reactive covers everything you need to know to get started, including:
We recommend you start there!
The Vert.x and Hibernate Reactive How-to explains how to use Hibernate Reactive in Vert.x.
examples contains several small projects showing
different features of Hibernate Reactive:
A list of quickstarts for Quarkus is available on GitHub:
Or you can generate a new Quarks project that uses the Hibernate Reactive extension and start coding right away.
With JBang you can run one of the examples available in the catalog without having to clone the repository or setup the project in the IDE. Once you have downloaded JBang, the list of examples is available via:
jbang alias list hibernate/hibernate-reactive
If you want to run one of the example (in this case the one called
example), you can do it with:
jbang [email protected]/hibernate-reactive
or you can open it in your editor (IntelliJ IDEA in this case) with:
jbang edit --open=idea [email protected]/hibernate-reactive
The project is built with Gradle, but you do not need to have Gradle installed on your machine.
To compile this project, navigate to the
To publish Hibernate Reactive to your local Maven repository, run:
To build the API and Reference documentation type:
You'll find the generated documentation in the subdirectory
open release/build/documentation/reference/html_single/index.html open release/build/documentation/javadocs/index.html
To run the tests, you'll need to decide which RDBMS you want to test with, and then get an instance of the test database running on your machine.
By default, the tests will be run against PostgreSQL. To test against
MySQL, MariaDB, or Db2, you must explicitly specify
-Pdb=db2, for example:
./gradlew test -Pdb=db2
It's also possible to run all tests or only selected tests on all available databases:
./gradlew testAll -PincludeTests=DefaultPortTest
includeTests represents the name of the test to run
and can contain the wildcard '*'. The property is optional but
running all tests on all databases might take a lot of time.
You can also enable/disable logging standard output streams for your tests by adding the following property:
There are three ways to start the test database.
If you have Docker installed, running the tests is really easy. You don't need to create the test databases manually. Just type:
./gradlew test -Pdocker
./gradlew test -Pdocker -Pdb=mysql
./gradlew test -Pdocker -Pdb=maria
./gradlew test -Pdocker -Pdb=db2
The tests will run faster if you reuse the same containers across
multiple test runs. To do this, edit the testcontainers configuration
.testcontainers.properties in your home directory, adding the
testcontainers.reuse.enable=true. (Just create the file if it
doesn't already exist.)
If you already have PostgreSQL installed on your machine, you'll just need to create the test database. From the command line, type the following commands:
psql create database hreact; create user hreact with password 'hreact'; grant all privileges on database hreact to hreact; alter user hreact createdb;
./gradlew test from the
If you have MySQL installed, you can create the test database using the following commands:
mysql -uroot create database hreact; create user hreact identified by 'hreact'; grant all on hreact.* to hreact;
./gradlew test -Pdb=mysql from the
We're working hard to support the full feature set of Hibernate ORM. At present several minor limitations remain.
@Versionproperties is not yet supported.
@org.hibernate.annotations.CollectionIdis not yet supported.