{"id":14969052,"url":"https://github.com/hibernate/hibernate-reactive","last_synced_at":"2026-04-01T19:41:16.612Z","repository":{"id":37072363,"uuid":"167560012","full_name":"hibernate/hibernate-reactive","owner":"hibernate","description":"A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.","archived":false,"fork":false,"pushed_at":"2025-05-14T09:44:25.000Z","size":8878,"stargazers_count":455,"open_issues_count":95,"forks_count":96,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-05-14T09:45:29.769Z","etag":null,"topics":["cockroachdb","db2","hibernate","jpa","mariadb","mysql","oracle","orm","postgresql","quarkus","reactive","vertx"],"latest_commit_sha":null,"homepage":"https://hibernate.org/reactive","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hibernate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-25T14:28:07.000Z","updated_at":"2025-05-14T09:43:33.000Z","dependencies_parsed_at":"2023-02-16T22:01:40.944Z","dependency_job_id":"81b37c04-4370-4c12-85a0-09cc0497e2ec","html_url":"https://github.com/hibernate/hibernate-reactive","commit_stats":null,"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hibernate%2Fhibernate-reactive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hibernate%2Fhibernate-reactive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hibernate%2Fhibernate-reactive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hibernate%2Fhibernate-reactive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hibernate","download_url":"https://codeload.github.com/hibernate/hibernate-reactive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501554,"owners_count":22081528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cockroachdb","db2","hibernate","jpa","mariadb","mysql","oracle","orm","postgresql","quarkus","reactive","vertx"],"created_at":"2024-09-24T13:41:03.348Z","updated_at":"2026-04-01T19:41:16.603Z","avatar_url":"https://github.com/hibernate.png","language":"Java","funding_links":[],"categories":["Java","并发编程"],"sub_categories":[],"readme":"[![Hibernate team logo](http://static.jboss.org/hibernate/images/hibernate_logo_whitebkg_200px.png)](https://hibernate.org/reactive)\n\n[![Main branch build status](https://img.shields.io/github/actions/workflow/status/hibernate/hibernate-reactive/build.yml?label=Hibernate%20Reactive%20CI\u0026style=for-the-badge)](https://github.com/hibernate/hibernate-reactive/actions?query=workflow%3A%22Hibernate+Reactive+CI%22)\n[![Apache 2.0 license](https://img.shields.io/badge/License-APACHE%202.0-green.svg?logo=APACHE\u0026style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)\n[![Latest version on Maven Central](https://img.shields.io/maven-central/v/org.hibernate.reactive/hibernate-reactive-core.svg?label=Maven%20Central\u0026logo=apache-maven\u0026style=for-the-badge)](https://search.maven.org/search?q=g:org.hibernate.reactive)\n[![Developers stream on Zulip](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg?logo=zulip\u0026style=for-the-badge)](https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev)\n[![Hibernate Reactive documentation](https://img.shields.io/badge/Hibernate-Documentation-orange.svg?logo=Hibernate\u0026style=for-the-badge)](https://hibernate.org/reactive/documentation/)\n[![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/hibernate/reactive/hibernate-reactive/badge.json\u0026style=for-the-badge)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/hibernate/reactive/hibernate-reactive/README.md)\n\n# Hibernate Reactive\n\nA reactive API for [Hibernate ORM][], supporting non-blocking database\ndrivers and a reactive style of interaction with the database.\n\nHibernate Reactive may be used in any plain Java program, but is \nespecially targeted toward usage in reactive environments like \n[Quarkus][] and [Vert.x][].\n\nCurrently [PostgreSQL][], [MySQL][], [MariaDB][], [Db2][], \n[CockroachDB][], [MS SQL Server][MSSQL] and [Oracle][] are supported.\n\nLearn more at \u003chttp://hibernate.org/reactive\u003e.\n\n[Hibernate ORM]: https://hibernate.org/orm/\n[Quarkus]: https://quarkus.io\n[Quarkus quickstarts]: https://github.com/quarkusio/quarkus-quickstarts\n[Vert.x]: https://vertx.io\n\n## Compatibility\n\nHibernate Reactive has been tested with:\n\n- Java 17, 21, 26\n- PostgreSQL 18\n- MySQL 9\n- MariaDB 12\n- Db2 12\n- CockroachDB v26\n- MS SQL Server 2025\n- Oracle 23\n- [Hibernate ORM][] 7.3\n- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 5.0\n- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 5.0\n- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 5.0\n- [Vert.x Reactive MS SQL Server Client](https://vertx.io/docs/vertx-mssql-client/java/) 5.0\n- [Vert.x Reactive Oracle Client](https://vertx.io/docs/vertx-oracle-client/java/) 5.0\n- [Quarkus][Quarkus] via the Hibernate Reactive extension\n\nThe exact version of the libraries and images are in the\n[catalog](https://github.com/hibernate/hibernate-reactive/blob/main/gradle/libs.versions.toml)\nand in the [tooling/docker](https://github.com/hibernate/hibernate-reactive/tree/main/tooling/docker) folder.\n\n[PostgreSQL]: https://www.postgresql.org\n[MySQL]: https://www.mysql.com\n[MariaDB]: https://mariadb.com\n[DB2]: https://www.ibm.com/analytics/db2\n[CockroachDB]: https://www.cockroachlabs.com/\n[MSSQL]: https://www.microsoft.com/en-gb/sql-server\n[Oracle]: https://www.oracle.com/database/\n\n## Documentation\n\nThe [Introduction to Hibernate Reactive][introduction] covers \neverything you need to know to get started, including:\n\n- [setting up a project][build] that uses Hibernate Reactive and the \n  Vert.x reactive SQL client for your database,\n- [configuring][config] Hibernate Reactive to access your database,\n- writing Java code to [define the entities][model] of your data model, \n- writing reactive data access code [using a reactive session][session], \n  and\n- [tuning the performance][performance] of your program.\n\nWe recommend you start there!\n\nThe [Vert.x and Hibernate Reactive How-to][vertx-hr] explains how to use\nHibernate Reactive in Vert.x.\n\nThe [Hibernate Reactive with Panache Guide][reactive-panache] introduces\nPanache Reactive, an active record-style API based on Hibernate Reactive.\n\n[introduction]: https://github.com/hibernate/hibernate-reactive/blob/main/documentation/src/main/asciidoc/reference/introduction.adoc\n\n[build]: https://github.com/hibernate/hibernate-reactive/blob/main/documentation/src/main/asciidoc/reference/introduction.adoc#including-hibernate-reactive-in-your-project-build\n[config]: https://github.com/hibernate/hibernate-reactive/blob/main/documentation/src/main/asciidoc/reference/introduction.adoc#basic-configuration\n[model]: https://github.com/hibernate/hibernate-reactive/blob/main/documentation/src/main/asciidoc/reference/introduction.adoc#mapping-entity-classes\n[session]: https://github.com/hibernate/hibernate-reactive/blob/main/documentation/src/main/asciidoc/reference/introduction.adoc#using-the-reactive-session\n[performance]: https://github.com/hibernate/hibernate-reactive/blob/main/documentation/src/main/asciidoc/reference/introduction.adoc#tuning-and-performance\n\n[vertx-hr]: https://how-to.vertx.io/hibernate-reactive-howto/\n[reactive-panache]: https://quarkus.io/guides/hibernate-reactive-panache\n\n## Examples\n\nThe directory [`examples`][examples] contains several small projects showing\ndifferent features of Hibernate Reactive:\n\n  - [CRUD operations using the session](https://github.com/hibernate/hibernate-reactive/tree/main/examples/session-example)\n  - [Native queries and stateless session](https://github.com/hibernate/hibernate-reactive/tree/main/examples/native-sql-example)\n\n[examples]: https://github.com/hibernate/hibernate-reactive/tree/main/examples\n\n## Quarkus quickstarts\n\nA collection of [quickstarts][Quarkus quickstarts] for Quarkus is available on GitHub:\n\n  - [Hibernate Reactive with RESTEasy Reactive](https://github.com/quarkusio/quarkus-quickstarts/tree/main/hibernate-reactive-quickstart)\n  - [Hibernate Reactive with Panache](https://github.com/quarkusio/quarkus-quickstarts/tree/main/hibernate-reactive-panache-quickstart)\n  - [Hibernate Reactive with Vert.x Web Routes](https://github.com/quarkusio/quarkus-quickstarts/tree/main/hibernate-reactive-routes-quickstart)\n\nOr you can [generate a new Quarkus project](https://code.quarkus.io/?g=org.acme\u0026a=code-with-quarkus\u0026v=1.0.0-SNAPSHOT\u0026b=MAVEN\u0026s=r1s\u0026cn=code.quarkus.io)\nthat uses the Hibernate Reactive extension and start coding right away.\n\n## Examples using JBang\n\nWith [JBang](https://www.jbang.dev/) you can run one of the examples available in the catalog\nwithout having to clone the repository or setup the project in the IDE.\nOnce you have downloaded JBang, the list of examples is available via: \n```\njbang alias list hibernate/hibernate-reactive\n```\n\nIf you want to run one of the example (in this case the one called `example`), you can do it with:\n```\njbang example@hibernate/hibernate-reactive\n```\n\nor you can [open it in your editor](https://github.com/jbangdev/jbang#editing) (IntelliJ IDEA in this case) with:\n```\njbang edit --open=idea testcase@hibernate/hibernate-reactive\n```\n\nYou can also generate and run a db-specific test. See available templates using: `jbang template list`\n\n```\ncockroachdb-reproducer = Template for a test with CockroachDB using Junit 4, Vert.x Unit and Testcontainers\ndb2-reproducer = Template for a test with Db2 using Junit 4, Vert.x Unit and Testcontainers\nmariadb-reproducer = Template for a test with MariaDB using Junit 4, Vert.x Unit and Testcontainers\nmysql-reproducer = Template for a test with MySQL using Junit 4, Vert.x Unit and Testcontainers\npg-reproducer = Template for a test with PostgreSQL using Junit 4, Vert.x Unit and Testcontainers\n```\n\nExample for PostgreSQL:\n  - Generate java test from template: `jbang init --template=pg-reproducer pgTest.java`\n  - Run the test: `jbang pgTest.java` \n\n## Gradle build\n\nThe project is built with Gradle, but you do _not_ need to have Gradle\ninstalled on your machine.\n\n### Building\n\nTo compile this project, navigate to the `hibernate-reactive` directory, \nand type:\n\n    ./gradlew compileJava\n\nTo publish Hibernate Reactive to your local Maven repository, run:\n\n    ./gradlew publishToMavenLocal\n\n### Building documentation\n\nTo build the API and Reference documentation type:\n\n    ./gradlew assembleDocumentation\n\nYou'll find the generated documentation in the subdirectory\n`release/build/documentation`.\n\n    open release/build/documentation/reference/html_single/index.html\n    open release/build/documentation/javadocs/index.html\n\n### Running tests\n\nBy default, the tests use [Testcontainers](https://www.testcontainers.org/)\nto automatically manage database instances in Docker containers. The\ntests will run against PostgreSQL unless you specify a different database\nusing the `-Pdb` property or use the dedicated task, as shown in the table below.\n\n| Database   | Command                      | Dedicated task                   |\n|------------|------------------------------|----------------------------------|\n| PostgreSQL | `./gradlew test -Pdb=pg`     | `./gradlew testDbPostgreSQL`     |\n| MySQL      | `./gradlew test -Pdb=mysql`  | `./gradlew testDbMySQL`          |\n| MariaDB    | `./gradlew test -Pdb=maria`  | `./gradlew testDbMariaDB`        |\n| DB2        | `./gradlew test -Pdb=db2`    | `./gradlew testDbDB2`            |\n| SQL Server | `./gradlew test -Pdb=mssql`  | `./gradlew testDbMSSQLServer`    |\n| Oracle     | `./gradlew test -Pdb=oracle` | `./gradlew testDbOracle`         |\n| CockroachDB| `./gradlew test -Pdb=cockroachdb` | `./gradlew testDbCockroachDB` |\n\nIt's even possible (but not recommended) to run all tests on all available databases:\n\n    ./gradlew testAll\n\nTo run specific tests on all databases, use the standard Gradle `--tests` flag:\n\n    ./gradlew testAll --tests=\"*SessionTest*\"\n\nThe `--tests` flag works with all test tasks:\n\n    ./gradlew test --tests=\"*SessionTest*\"\n    ./gradlew testDbMySQL --tests=\"DefaultPortTest\"\n    ./gradlew testDbPostgreSQL testDbMySQL --tests=\"*SessionTest*\"\n\nTo enable logging of the standard output streams, add the property \n`-PshowStandardOutput`.\n\nThere are three ways to start the test database.\n\n#### Using Testcontainers (default)\n\nBy default, the tests use [Testcontainers](https://www.testcontainers.org/)\nto automatically start database containers. If you have Docker installed,\nrunning the tests is really easy - you don't need to create the test\ndatabases manually. Just type:\n\n    ./gradlew test\n\nThe above command will start an instance of PostgreSQL in a Docker\ncontainer. You may specify a different database using one of the\ncommands show in the table below.\n\n| Database   | Command                      | Dedicated task                   |\n|------------|------------------------------|----------------------------------|\n| PostgreSQL | `./gradlew test -Pdb=pg`     | `./gradlew testDbPostgreSQL`     |\n| MySQL      | `./gradlew test -Pdb=mysql`  | `./gradlew testDbMySQL`          |\n| MariaDB    | `./gradlew test -Pdb=maria`  | `./gradlew testDbMariaDB`        |\n| DB2        | `./gradlew test -Pdb=db2`    | `./gradlew testDbDB2`            |\n| SQL Server | `./gradlew test -Pdb=mssql`  | `./gradlew testDbMSSQLServer`    |\n| Oracle     | `./gradlew test -Pdb=oracle` | `./gradlew testDbOracle`         |\n| CockroachDB| `./gradlew test -Pdb=cockroachdb` | `./gradlew testDbCockroachDB` |\n\nThe tests will run faster if you reuse the same containers across\nmultiple test runs. To do this, edit the testcontainers configuration\nfile `.testcontainers.properties` in your home directory, adding the\nline `testcontainers.reuse.enable=true`. (Just create the file if it\ndoesn't already exist.)\n\nIf you prefer to test on a database that's not started by Testcontainers,\nyou can use the parameters `-PskipTestcontainers`.\n\n#### If you already have PostgreSQL installed\n\nIf you already have PostgreSQL installed on your machine, you'll just \nneed to create the test database. From the command line, type the \nfollowing commands:\n\n    psql\n    create database hreact;\n    create user hreact with password 'hreact';\n    grant all privileges on database hreact to hreact;\n    alter user hreact createdb;\n\nThen run `./gradlew test -PskipTestcontainers` from the `hibernate-reactive` directory.\n\n#### If you already have MySQL installed\n\nIf you have MySQL installed, you can create the test database using\nthe following commands:\n\n    mysql -uroot\n    create database hreact;\n    create user hreact identified by 'hreact';\n    grant all on hreact.* to hreact;\n\nThen run `./gradlew test -Pdb=mysql -PskipTestcontainers` from the `hibernate-reactive`\ndirectory.\n\n#### If you have Podman\n\nIf you have [Podman][podman] installed, you can start the test\ndatabase by following the instructions in [podman.md](podman.md).\n\n[podman]: https://podman.io\n\n## Limitations\n\nWe're working hard to support the full feature set of Hibernate ORM. \nAt present several minor limitations remain.\n\n- The annotation `@org.hibernate.annotations.Source` for \n  database-generated `@Version` properties is not yet supported.\n- The annotation `@org.hibernate.annotations.CollectionId` is not yet \n  supported.\n- With Db2:\n  * [Automatic schema](http://hibernate.org/reactive/documentation/1.1/reference/html_single/#_automatic_schema_export) update and validation is not supported.\n  * `@Lob` annotation is not supported - See [this issue on the vertx-db2-client](https://github.com/eclipse-vertx/vertx-sql-client/issues/496)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhibernate%2Fhibernate-reactive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhibernate%2Fhibernate-reactive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhibernate%2Fhibernate-reactive/lists"}