Skip to content

Commit 0f5f40e

Browse files
committed
update the info about reactive repositories
1 parent 7b522e6 commit 0f5f40e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

documentation/src/main/asciidoc/repositories/Reactive.adoc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,27 @@
33

44
Hibernate Data Repositories provides repositories backed by https://hibernate.org/reactive/[Hibernate Reactive] for use in reactive programming.
55
The methods of a reactive repository are non-blocking, and so every operation returns a reactive stream.
6-
This is an extension to the programming model defined by Jakarta Data.
76

87
[NOTE]
98
====
10-
The Jakarta Data specification has not yet defined a way to write repositories for use in reactive programming, but the spec was written to accommodate such extensions, and this capability might be standardized in a future release.
9+
Jakarta Data 1.0 does not define a way to write repositories for use in reactive programming, but the spec was written to accommodate such extensions.
10+
This capability is being written into Data 1.1 under the more general category of _asynchronous repositories_.
1111
====
1212

1313
In Hibernate Data Repositories we use https://smallrye.io/smallrye-mutiny/[Mutiny] to work with reactive streams.
1414

15-
[WARNING]
15+
[CAUTION]
1616
====
17-
If and when Jakarta Data _does_ provide standard support for reactive repositories, the functionality will almost certainly be based on Java's `CompletionStage`, and not on Mutiny.
17+
A future version of Hibernate Data Repositories will also allow the use of `CompletionStage` from `java.util.concurrent`.
18+
Asynchronous repositories based on Mutiny are unlikely to ever be portable to other implementations of Jakarta Data.
1819
====
1920

2021
In our opinion, Mutiny is a _much_ more comfortable API than `CompletionStage`.
2122

23+
[TIP]
24+
The documentation for Hibernate Reactive contains a https://hibernate.org/reactive/documentation/3.0/reference/html_single/#_apis_for_chaining_reactive_operations[comparison table] that's useful if you're more familiar with `CompletionStage`.
25+
26+
2227
=== Defining a reactive repository
2328

2429
In the following code example we notice the two requirements for a reactive repository in Hibernate Data Repositories:

0 commit comments

Comments
 (0)