Skip to content

Commit d7f9ed9

Browse files
committed
very minor javadoc fixes
1 parent 8a2bbe5 commit d7f9ed9

File tree

3 files changed

+86
-66
lines changed

3 files changed

+86
-66
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/mutiny/Mutiny.java

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,7 @@ interface SessionFactory extends AutoCloseable {
20302030

20312031

20322032
/**
2033-
* Perform work using a {@link Session reactive session}.
2033+
* Perform work using a {@linkplain Session reactive session}.
20342034
* <p>
20352035
* <il>
20362036
* <li>If there is already a session associated with the current
@@ -2049,7 +2049,7 @@ interface SessionFactory extends AutoCloseable {
20492049
<T> Uni<T> withSession(Function<Session, Uni<T>> work);
20502050

20512051
/**
2052-
* Perform work using a {@link Session reactive session} for
2052+
* Perform work using a {@linkplain Session reactive session} for
20532053
* a specified tenant.
20542054
* <p>
20552055
* <il>
@@ -2069,12 +2069,12 @@ interface SessionFactory extends AutoCloseable {
20692069
<T> Uni<T> withSession(String tenantId, Function<Session, Uni<T>> work);
20702070

20712071
/**
2072-
* Perform work using a {@link Session reactive session} within an
2073-
* associated {@link Transaction transaction}.
2072+
* Perform work using a {@linkplain Session reactive session}
2073+
* within an associated {@link Transaction transaction}.
20742074
* <p>
20752075
* <il>
2076-
* <li>If there is already a session associated with the
2077-
* current reactive stream, then the work will be executed using that
2076+
* <li>If there is already a session associated with the current
2077+
* reactive stream, then the work will be executed using that
20782078
* session.
20792079
* <li>Otherwise, if there is no session associated with the
20802080
* current stream, a new session will be created.
@@ -2092,12 +2092,12 @@ interface SessionFactory extends AutoCloseable {
20922092
<T> Uni<T> withTransaction(BiFunction<Session, Transaction, Uni<T>> work);
20932093

20942094
/**
2095-
* Perform work using a {@link Session reactive session} within an
2096-
* associated transaction.
2095+
* Perform work using a {@linkplain Session reactive session}
2096+
* within an associated transaction.
20972097
* <p>
20982098
* <il>
2099-
* <li>If there is already a session associated with the
2100-
* current reactive stream, then the work will be executed using that
2099+
* <li>If there is already a session associated with the current
2100+
* reactive stream, then the work will be executed using that
21012101
* session.
21022102
* <li>Otherwise, if there is no session associated with the
21032103
* current stream, a new session will be created.
@@ -2117,8 +2117,8 @@ default <T> Uni<T> withTransaction(Function<Session, Uni<T>> work) {
21172117
}
21182118

21192119
/**
2120-
* Perform work using a {@link StatelessSession reactive session} within an
2121-
* associated {@link Transaction transaction}.
2120+
* Perform work using a {@linkplain StatelessSession reactive session}
2121+
* within an associated {@link Transaction transaction}.
21222122
* <p>
21232123
* <il>
21242124
* <li>If there is already a stateless session associated with the
@@ -2128,10 +2128,11 @@ default <T> Uni<T> withTransaction(Function<Session, Uni<T>> work) {
21282128
* current stream, a new stateless session will be created.
21292129
* </il>
21302130
* <p>
2131-
* The session will be closed automatically and the transaction committed automatically.
2131+
* The session will be closed automatically and the transaction committed
2132+
* automatically.
21322133
*
2133-
* @param work a function which accepts the stateless session and returns
2134-
* the result of the work as a {@link Uni}.
2134+
* @param work a function which accepts the stateless session and
2135+
* returns the result of the work as a {@link Uni}.
21352136
*
21362137
* @see #withStatelessSession(Function)
21372138
* @see StatelessSession#withTransaction(Function)
@@ -2141,8 +2142,8 @@ default <T> Uni<T> withStatelessTransaction(Function<StatelessSession, Uni<T>> w
21412142
}
21422143

21432144
/**
2144-
* Perform work using a {@link StatelessSession reactive session} within an
2145-
* associated {@link Transaction transaction}.
2145+
* Perform work using a {@linkplain StatelessSession reactive session}
2146+
* within an associated {@link Transaction transaction}.
21462147
* <p>
21472148
* <il>
21482149
* <li>If there is already a stateless session associated with the
@@ -2152,7 +2153,8 @@ default <T> Uni<T> withStatelessTransaction(Function<StatelessSession, Uni<T>> w
21522153
* current stream, a new stateless session will be created.
21532154
* </il>
21542155
* <p>
2155-
* The session will be closed automatically and the transaction committed automatically.
2156+
* The session will be closed automatically and the transaction committed
2157+
* automatically.
21562158
*
21572159
* @param work a function which accepts the stateless session and returns
21582160
* the result of the work as a {@link Uni}.
@@ -2163,7 +2165,7 @@ default <T> Uni<T> withStatelessTransaction(Function<StatelessSession, Uni<T>> w
21632165
<T> Uni<T> withStatelessTransaction(BiFunction<StatelessSession, Transaction, Uni<T>> work);
21642166

21652167
/**
2166-
* Perform work using a {@link StatelessSession stateless session}.
2168+
* Perform work using a {@linkplain StatelessSession stateless session}.
21672169
* <p>
21682170
* <il>
21692171
* <li>If there is already a stateless session associated with the
@@ -2181,14 +2183,15 @@ default <T> Uni<T> withStatelessTransaction(Function<StatelessSession, Uni<T>> w
21812183
<T> Uni<T> withStatelessSession(Function<StatelessSession, Uni<T>> work);
21822184

21832185
/**
2184-
* Perform work using a {@link StatelessSession stateless session}.
2186+
* Perform work using a {@linkplain StatelessSession stateless session}.
21852187
* <p>
21862188
* <il>
21872189
* <li>If there is already a stateless session associated with the
2188-
* current reactive stream and given tenant id, then the work will be executed using that
2189-
* session.
2190+
* current reactive stream and given tenant id, then the work will be
2191+
* executed using that session.
21902192
* <li>Otherwise, if there is no stateless session associated with the
2191-
* current stream and given tenant id, a new stateless session will be created.
2193+
* current stream and given tenant id, a new stateless session will be
2194+
* created.
21922195
* </il>
21932196
* <p>
21942197
* The session will be closed automatically.
@@ -2200,15 +2203,17 @@ default <T> Uni<T> withStatelessTransaction(Function<StatelessSession, Uni<T>> w
22002203
<T> Uni<T> withStatelessSession(String tenantId, Function<StatelessSession, Uni<T>> work);
22012204

22022205
/**
2203-
* Perform work using a {@link Session reactive session} for a
2204-
* specified tenant within an associated {@link Transaction transaction}.
2206+
* Perform work using a {@linkplain Session reactive session} for
2207+
* the tenant with the specified tenant id within an associated
2208+
* {@link Transaction transaction}.
22052209
* <p>
22062210
* <il>
2207-
* <li>If there is already a session associated with the
2208-
* current reactive stream and given tenant id, then the work will be executed using that
2209-
* session.
2211+
* <li>If there is already a session associated with the current
2212+
* reactive stream and given tenant id, then the work will be
2213+
* executed using that session.
22102214
* <li>Otherwise, if there is no session associated with the
2211-
* current stream and given tenant id, a new stateless session will be created.
2215+
* current stream and given tenant id, a new stateless session
2216+
* will be created.
22122217
* </il>
22132218
* <p>
22142219
* The session will be {@link Session#flush() flushed} and closed
@@ -2224,18 +2229,21 @@ default <T> Uni<T> withStatelessTransaction(Function<StatelessSession, Uni<T>> w
22242229
<T> Uni<T> withTransaction(String tenantId, BiFunction<Session, Transaction, Uni<T>> work);
22252230

22262231
/**
2227-
* Perform work using a {@link StatelessSession reactive session} for a
2228-
* specified tenant within an associated {@link Transaction transaction}.
2232+
* Perform work using a {@linkplain StatelessSession reactive session}
2233+
* for the tenant with the specified tenant id within an associated
2234+
* {@link Transaction transaction}.
22292235
* <p>
22302236
* <il>
22312237
* <li>If there is already a stateless session associated with the
2232-
* current reactive stream and given tenant id, then the work will be executed using that
2233-
* session.
2238+
* current reactive stream and given tenant id, then the work will be
2239+
* executed using that session.
22342240
* <li>Otherwise, if there is no stateless session associated with the
2235-
* current stream and given tenant id, a new stateless session will be created.
2241+
* current stream and given tenant id, a new stateless session will be
2242+
* created.
22362243
* </il>
22372244
* <p>
2238-
* The session will be closed automatically and the transaction committed automatically.
2245+
* The session will be closed automatically and the transaction committed
2246+
* automatically.
22392247
*
22402248
* @param tenantId the id of the tenant
22412249
* @param work a function which accepts the stateless session and returns

hibernate-reactive-core/src/main/java/org/hibernate/reactive/mutiny/impl/MutinyStatelessSessionImpl.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ public Mutiny.Transaction currentTransaction() {
300300
private class Transaction<T> implements Mutiny.Transaction {
301301
boolean rollback;
302302

303+
/**
304+
* Execute the given work in a new transaction. Called only
305+
* when no existing transaction was active.
306+
*/
303307
Uni<T> execute(Function<Mutiny.Transaction, Uni<T>> work) {
304308
currentTransaction = this;
305309
return begin()
@@ -308,14 +312,15 @@ Uni<T> execute(Function<Mutiny.Transaction, Uni<T>> work) {
308312
}
309313

310314
/**
311-
* Run the code assuming that a transaction has already started so that we can
312-
* differentiate an error starting a transaction (and therefore doesn't need to rollback)
313-
* and an error thrown by the work.
315+
* Run the code assuming that a transaction has already started
316+
* so that we can differentiate an error starting a transaction
317+
* (which therefore does not need to trigger rollback) from an
318+
* error thrown by the work (which does).
314319
*/
315320
Uni<T> executeInTransaction(Function<Mutiny.Transaction, Uni<T>> work) {
316321
return Uni.createFrom().deferred( () -> work.apply( this ) )
317322
// in the case of an exception or cancellation
318-
// we need to rollback the transaction
323+
// we need to roll back the transaction
319324
.onFailure().call( this::rollback )
320325
.onCancellation().call( this::rollback )
321326
// finally, when there was no exception,

hibernate-reactive-core/src/main/java/org/hibernate/reactive/stage/Stage.java

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,7 @@ interface Transaction {
19801980
interface SessionFactory extends AutoCloseable {
19811981

19821982
/**
1983-
* Obtain a new {@link Session reactive session} {@link CompletionStage}, the main
1983+
* Obtain a new {@linkplain Session reactive session} {@link CompletionStage}, the main
19841984
* interaction point between the user's program and Hibernate
19851985
* Reactive.
19861986
* <p>
@@ -1994,7 +1994,7 @@ interface SessionFactory extends AutoCloseable {
19941994
CompletionStage<Session> openSession();
19951995

19961996
/**
1997-
* Obtain a new {@link Session reactive session} {@link CompletionStage} for a
1997+
* Obtain a new {@linkplain Session reactive session} {@link CompletionStage} for a
19981998
* specified tenant.
19991999
* <p>
20002000
* When the {@link CompletionStage} completes successfully it returns a newly created session.
@@ -2033,7 +2033,7 @@ interface SessionFactory extends AutoCloseable {
20332033
CompletionStage<StatelessSession> openStatelessSession(String tenantId);
20342034

20352035
/**
2036-
* Perform work using a {@link Session reactive session}.
2036+
* Perform work using a {@linkplain Session reactive session}.
20372037
* <p>
20382038
* <il>
20392039
* <li>If there is already a session associated with the current
@@ -2052,7 +2052,7 @@ interface SessionFactory extends AutoCloseable {
20522052
<T> CompletionStage<T> withSession(Function<Session, CompletionStage<T>> work);
20532053

20542054
/**
2055-
* Perform work using a {@link Session reactive session} for a
2055+
* Perform work using a {@linkplain Session reactive session} for a
20562056
* specified tenant.
20572057
* <p>
20582058
* <il>
@@ -2072,7 +2072,7 @@ interface SessionFactory extends AutoCloseable {
20722072
<T> CompletionStage<T> withSession(String tenantId, Function<Session, CompletionStage<T>> work);
20732073

20742074
/**
2075-
* Perform work using a {@link Session reactive session} within an
2075+
* Perform work using a {@linkplain Session reactive session} within an
20762076
* associated {@link Transaction transaction}.
20772077
* <p>
20782078
* <il>
@@ -2096,7 +2096,7 @@ interface SessionFactory extends AutoCloseable {
20962096
<T> CompletionStage<T> withTransaction(BiFunction<Session, Transaction, CompletionStage<T>> work);
20972097

20982098
/**
2099-
* Perform work using a {@link Session reactive session} within an
2099+
* Perform work using a {@linkplain Session reactive session} within an
21002100
* associated transaction.
21012101
* <p>
21022102
* <il>
@@ -2121,15 +2121,17 @@ default <T> CompletionStage<T> withTransaction(Function<Session, CompletionStage
21212121
}
21222122

21232123
/**
2124-
* Perform work using a {@link Session reactive session} for a
2125-
* specified tenant within an associated {@link Transaction transaction}.
2124+
* Perform work using a {@linkplain Session reactive session} for
2125+
* the tenant with the specified tenant id within an associated
2126+
* {@link Transaction transaction}.
21262127
* <p>
21272128
* <il>
2128-
* <li>If there is already a session associated with the
2129-
* current reactive stream and the given tenant, then the work will be executed using that
2130-
* session.
2131-
* <li>Otherwise, if there is no stateless session associated with the
2132-
* current stream and the given tenant, a new stateless session will be created.
2129+
* <li>If there is already a session associated with the current
2130+
* reactive stream and given tenant id, then the work will be
2131+
* executed using that session.
2132+
* <li>Otherwise, if there is no stateless session associated with
2133+
* the current stream and given tenant id, a new stateless session
2134+
* will be created.
21332135
* </il>
21342136
* <p>
21352137
* The session will be {@link Session#flush() flushed} and closed
@@ -2145,8 +2147,8 @@ default <T> CompletionStage<T> withTransaction(Function<Session, CompletionStage
21452147
<T> CompletionStage<T> withTransaction(String tenantId, BiFunction<Session, Transaction, CompletionStage<T>> work);
21462148

21472149
/**
2148-
* Perform work using a {@link StatelessSession reactive session} within an
2149-
* associated {@link Transaction transaction}.
2150+
* Perform work using a {@linkplain StatelessSession reactive session}
2151+
* within an associated {@link Transaction transaction}.
21502152
* <p>
21512153
* <il>
21522154
* <li>If there is already a stateless session associated with the
@@ -2156,7 +2158,8 @@ default <T> CompletionStage<T> withTransaction(Function<Session, CompletionStage
21562158
* current stream, a new stateless session will be created.
21572159
* </il>
21582160
* <p>
2159-
* The session will be closed automatically, and the transaction committed automatically.
2161+
* The session will be closed automatically, and the transaction committed
2162+
* automatically.
21602163
*
21612164
* @param work a function which accepts the stateless session and returns
21622165
* the result of the work as a {@link CompletionStage}.
@@ -2169,8 +2172,8 @@ default <T> CompletionStage<T> withStatelessTransaction(Function<StatelessSessio
21692172
}
21702173

21712174
/**
2172-
* Perform work using a {@link StatelessSession reactive session} within an
2173-
* associated {@link Transaction transaction}.
2175+
* Perform work using a {@linkplain StatelessSession reactive session}
2176+
* within an associated {@link Transaction transaction}.
21742177
* <p>
21752178
* <il>
21762179
* <li>If there is already a stateless session associated with the
@@ -2180,7 +2183,8 @@ default <T> CompletionStage<T> withStatelessTransaction(Function<StatelessSessio
21802183
* current stream, a new stateless session will be created.
21812184
* </il>
21822185
* <p>
2183-
* The session will be closed automatically, and the transaction committed automatically.
2186+
* The session will be closed automatically, and the transaction committed
2187+
* automatically.
21842188
*
21852189
* @param work a function which accepts the stateless session and returns
21862190
* the result of the work as a {@link CompletionStage}.
@@ -2191,18 +2195,21 @@ default <T> CompletionStage<T> withStatelessTransaction(Function<StatelessSessio
21912195
<T> CompletionStage<T> withStatelessTransaction(BiFunction<StatelessSession, Transaction, CompletionStage<T>> work);
21922196

21932197
/**
2194-
* Perform work using a {@link StatelessSession reactive session} within an
2195-
* associated {@link Transaction transaction}.
2198+
* Perform work using a {@linkplain StatelessSession reactive session}
2199+
* for the tenant with the specified tenant id within an associated
2200+
* {@link Transaction transaction}.
21962201
* <p>
21972202
* <il>
21982203
* <li>If there is already a stateless session associated with the
2199-
* current reactive stream and the given tenant, then the work will be executed using that
2200-
* session.
2204+
* current reactive stream and given tenant id, then the work will be
2205+
* executed using that session.
22012206
* <li>Otherwise, if there is no stateless session associated with the
2202-
* current stream, a new stateless session will be created.
2207+
* current stream and given tenant id, a new stateless session will be
2208+
* created.
22032209
* </il>
22042210
* <p>
2205-
* The session will be closed automatically, and the transaction committed automatically.
2211+
* The session will be closed automatically and the transaction committed
2212+
* automatically.
22062213
*
22072214
* @param tenantId the id of the tenant
22082215
* @param work a function which accepts the stateless session and returns
@@ -2214,7 +2221,7 @@ default <T> CompletionStage<T> withStatelessTransaction(Function<StatelessSessio
22142221
<T> CompletionStage<T> withStatelessTransaction(String tenantId, BiFunction<StatelessSession, Transaction, CompletionStage<T>> work);
22152222

22162223
/**
2217-
* Perform work using a {@link StatelessSession stateless session}.
2224+
* Perform work using a {@linkplain StatelessSession stateless session}.
22182225
* <p>
22192226
* <il>
22202227
* <li>If there is already a stateless session associated with the
@@ -2232,7 +2239,7 @@ default <T> CompletionStage<T> withStatelessTransaction(Function<StatelessSessio
22322239
<T> CompletionStage<T> withStatelessSession(Function<StatelessSession, CompletionStage<T>> work);
22332240

22342241
/**
2235-
* Perform work using a {@link StatelessSession stateless session}.
2242+
* Perform work using a {@linkplain StatelessSession stateless session}.
22362243
* <p>
22372244
* <il>
22382245
* <li>If there is already a stateless session associated with the

0 commit comments

Comments
 (0)