GithubHelp home page GithubHelp logo

briandykim / hibernate-reactive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hibernate/hibernate-reactive

0.0 0.0 0.0 4.96 MB

A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.

Home Page: https://hibernate.org/reactive

License: Apache License 2.0

Java 100.00%

hibernate-reactive's Introduction

Hibernate team logo

Main branch build status Apache 2.0 license Latest version on Maven Central Developers stream on Zulip Hibernate Reactive documentation

Hibernate Reactive

A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.

Hibernate Reactive may be used in any plain Java program, but is especially targeted toward usage in reactive environments like Quarkus and Vert.x.

Currently PostgreSQL, MySQL, MariaDB, Db2, CockroachDB, MS SQL Server and Oracle are supported.

Learn more at http://hibernate.org/reactive.

Compatibility

Hibernate Reactive has been tested with:

Documentation

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.

The Hibernate Reactive with Panache Guide introduces Panache Reactive, an active record-style API based on Hibernate Reactive.

Examples

The directory examples contains several small projects showing different features of Hibernate Reactive:

Quarkus quickstarts

A collection of quickstarts for Quarkus is available on GitHub:

Or you can generate a new Quarkus project that uses the Hibernate Reactive extension and start coding right away.

Examples using JBang

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 example@hibernate/hibernate-reactive

or you can open it in your editor (IntelliJ IDEA in this case) with:

jbang edit --open=idea testcase@hibernate/hibernate-reactive

Gradle build

The project is built with Gradle, but you do not need to have Gradle installed on your machine.

Building

To compile this project, navigate to the hibernate-reactive directory, and type:

./gradlew compileJava

To publish Hibernate Reactive to your local Maven repository, run:

./gradlew publishToMavenLocal

Building documentation

To build the API and Reference documentation type:

./gradlew assembleDocumentation

You'll find the generated documentation in the subdirectory release/build/documentation.

open release/build/documentation/reference/html_single/index.html
open release/build/documentation/javadocs/index.html

Running tests

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=mysql, -Pdb=maria, or -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

the property 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:

-PshowStandardOutput

There are three ways to start the test database.

If you have Docker installed

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

Or:

./gradlew test -Pdocker -Pdb=mysql

Or:

./gradlew test -Pdocker -Pdb=maria

Or:

./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 file .testcontainers.properties in your home directory, adding the line testcontainers.reuse.enable=true. (Just create the file if it doesn't already exist.)

If you already have PostgreSQL installed

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;

Then run ./gradlew test from the hibernate-reactive directory.

If you already have MySQL installed

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;

Then run ./gradlew test -Pdb=mysql from the hibernate-reactive directory.

If you have Podman

If you have Podman installed, you can start the test database by following the instructions in podman.md.

Limitations

We're working hard to support the full feature set of Hibernate ORM. At present several minor limitations remain.

  • The annotation @org.hibernate.annotations.Source for database-generated @Version properties is not yet supported.
  • The annotation @org.hibernate.annotations.CollectionId is not yet supported.
  • With Db2:

hibernate-reactive's People

Contributors

gavinking avatar davided avatar sanne avatar yrodiere avatar blafond avatar gbadner avatar aguibert avatar jponge avatar fromage avatar tsegismont avatar meepown avatar codingxu97 avatar cdmikechen avatar stuartwdouglas avatar maxandersen avatar geoand avatar gastaldi avatar edeandrea avatar conorpfarrell avatar dreab8 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.