Class SQLClientHelper
- java.lang.Object
-
- io.vertx.reactivex.ext.sql.SQLClientHelper
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.reactivex.Completable
inTransactionCompletable(SQLClient client, Function<SQLConnection,io.reactivex.Completable> sourceSupplier)
Generates aCompletable
fromSQLConnection
operations executed inside a transaction.static <T> io.reactivex.Flowable<T>
inTransactionFlowable(SQLClient client, Function<SQLConnection,io.reactivex.Flowable<T>> sourceSupplier)
Generates aFlowable
fromSQLConnection
operations executed inside a transaction.static <T> io.reactivex.Maybe<T>
inTransactionMaybe(SQLClient client, Function<SQLConnection,io.reactivex.Maybe<T>> sourceSupplier)
Generates aMaybe
fromSQLConnection
operations executed inside a transaction.static <T> io.reactivex.Observable<T>
inTransactionObservable(SQLClient client, Function<SQLConnection,io.reactivex.Observable<T>> sourceSupplier)
Generates aObservable
fromSQLConnection
operations executed inside a transaction.static <T> io.reactivex.Single<T>
inTransactionSingle(SQLClient client, Function<SQLConnection,io.reactivex.Single<T>> sourceSupplier)
Generates aSingle
fromSQLConnection
operations executed inside a transaction.static io.reactivex.CompletableTransformer
txCompletableTransformer(SQLConnection sqlConnection)
Creates aCompletableTransformer
decorating aCompletable
with transaction management for a givenSQLConnection
.static <T> io.reactivex.FlowableTransformer<T,T>
txFlowableTransformer(SQLConnection sqlConnection)
Creates aFlowableTransformer
decorating aFlowable
with transaction management for a givenSQLConnection
.static <T> io.reactivex.MaybeTransformer<T,T>
txMaybeTransformer(SQLConnection sqlConnection)
Creates aMaybeTransformer
decorating aMaybe
with transaction management for a givenSQLConnection
.static <T> io.reactivex.ObservableTransformer<T,T>
txObservableTransformer(SQLConnection sqlConnection)
Creates aObservableTransformer
decorating anObservable
with transaction management for a givenSQLConnection
.static <T> io.reactivex.SingleTransformer<T,T>
txSingleTransformer(SQLConnection sqlConnection)
Creates aSingleTransformer
decorating aSingle
with transaction management for a givenSQLConnection
.static io.reactivex.Completable
usingConnectionCompletable(SQLClient client, Function<SQLConnection,io.reactivex.Completable> sourceSupplier)
Generates aCompletable
fromSQLConnection
operations.static <T> io.reactivex.Flowable<T>
usingConnectionFlowable(SQLClient client, Function<SQLConnection,io.reactivex.Flowable<T>> sourceSupplier)
Generates aFlowable
fromSQLConnection
operations.static <T> io.reactivex.Maybe<T>
usingConnectionMaybe(SQLClient client, Function<SQLConnection,io.reactivex.Maybe<T>> sourceSupplier)
Generates aMaybe
fromSQLConnection
operations.static <T> io.reactivex.Observable<T>
usingConnectionObservable(SQLClient client, Function<SQLConnection,io.reactivex.Observable<T>> sourceSupplier)
Generates aObservable
fromSQLConnection
operations.static <T> io.reactivex.Single<T>
usingConnectionSingle(SQLClient client, Function<SQLConnection,io.reactivex.Single<T>> sourceSupplier)
Generates aSingle
fromSQLConnection
operations.
-
-
-
Method Detail
-
txFlowableTransformer
public static <T> io.reactivex.FlowableTransformer<T,T> txFlowableTransformer(SQLConnection sqlConnection)
Creates aFlowableTransformer
decorating aFlowable
with transaction management for a givenSQLConnection
.If the upstream
Flowable
completes (onComplete), the transaction is committed. If the upstreamFlowable
emits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnection
is put back in autocommit mode.- Type Parameters:
T
- the type of the items emitted by the upstreamFlowable
- Parameters:
sqlConnection
- theSQLConnection
used for database operations and transaction management- Returns:
- a
FlowableTransformer
decorating aFlowable
with transaction management
-
inTransactionFlowable
public static <T> io.reactivex.Flowable<T> inTransactionFlowable(SQLClient client, Function<SQLConnection,io.reactivex.Flowable<T>> sourceSupplier)
Generates aFlowable
fromSQLConnection
operations executed inside a transaction.- Type Parameters:
T
- the type of the items emitted by theFlowable
- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aFlowable
generated by interacting with the givenSQLConnection
- Returns:
- a
Flowable
generated fromSQLConnection
operations executed inside a transaction
-
txObservableTransformer
public static <T> io.reactivex.ObservableTransformer<T,T> txObservableTransformer(SQLConnection sqlConnection)
Creates aObservableTransformer
decorating anObservable
with transaction management for a givenSQLConnection
.If the upstream
Observable
completes (onComplete), the transaction is committed. If the upstreamObservable
emits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnection
is put back in autocommit mode.- Type Parameters:
T
- the type of the items emitted by the upstreamObservable
- Parameters:
sqlConnection
- theSQLConnection
used for database operations and transaction management- Returns:
- a
ObservableTransformer
decorating anObservable
with transaction management
-
inTransactionObservable
public static <T> io.reactivex.Observable<T> inTransactionObservable(SQLClient client, Function<SQLConnection,io.reactivex.Observable<T>> sourceSupplier)
Generates aObservable
fromSQLConnection
operations executed inside a transaction.- Type Parameters:
T
- the type of the items emitted by theObservable
- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aObservable
generated by interacting with the givenSQLConnection
- Returns:
- an
Observable
generated fromSQLConnection
operations executed inside a transaction
-
txSingleTransformer
public static <T> io.reactivex.SingleTransformer<T,T> txSingleTransformer(SQLConnection sqlConnection)
Creates aSingleTransformer
decorating aSingle
with transaction management for a givenSQLConnection
.If the upstream
Single
emits a value (onSuccess), the transaction is committed. If the upstreamSingle
emits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnection
is put back in autocommit mode.- Type Parameters:
T
- the type of the item emitted by the upstreamSingle
- Parameters:
sqlConnection
- theSQLConnection
used for database operations and transaction management- Returns:
- a
SingleTransformer
decorating aSingle
with transaction management
-
inTransactionSingle
public static <T> io.reactivex.Single<T> inTransactionSingle(SQLClient client, Function<SQLConnection,io.reactivex.Single<T>> sourceSupplier)
Generates aSingle
fromSQLConnection
operations executed inside a transaction.- Type Parameters:
T
- the type of the item emitted by theSingle
- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aSingle
generated by interacting with the givenSQLConnection
- Returns:
- a
Single
generated fromSQLConnection
operations executed inside a transaction
-
txMaybeTransformer
public static <T> io.reactivex.MaybeTransformer<T,T> txMaybeTransformer(SQLConnection sqlConnection)
Creates aMaybeTransformer
decorating aMaybe
with transaction management for a givenSQLConnection
.If the upstream
Maybe
emits a value (onSuccess) or completes (onComplete), the transaction is committed. If the upstreamMaybe
emits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnection
is put back in autocommit mode.- Type Parameters:
T
- the type of the item emitted by the upstreamMaybe
- Parameters:
sqlConnection
- theSQLConnection
used for database operations and transaction management- Returns:
- a
MaybeTransformer
decorating aMaybe
with transaction management
-
inTransactionMaybe
public static <T> io.reactivex.Maybe<T> inTransactionMaybe(SQLClient client, Function<SQLConnection,io.reactivex.Maybe<T>> sourceSupplier)
Generates aMaybe
fromSQLConnection
operations executed inside a transaction.- Type Parameters:
T
- the type of the item emitted by theMaybe
- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aMaybe
generated by interacting with the givenSQLConnection
- Returns:
- a
Maybe
generated fromSQLConnection
operations executed inside a transaction
-
txCompletableTransformer
public static io.reactivex.CompletableTransformer txCompletableTransformer(SQLConnection sqlConnection)
Creates aCompletableTransformer
decorating aCompletable
with transaction management for a givenSQLConnection
.If the upstream
Completable
completes (onComplete), the transaction is committed. If the upstreamCompletable
emits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnection
is put back in autocommit mode.- Parameters:
sqlConnection
- theSQLConnection
used for database operations and transaction management- Returns:
- a
CompletableTransformer
decorating aCompletable
with transaction management
-
inTransactionCompletable
public static io.reactivex.Completable inTransactionCompletable(SQLClient client, Function<SQLConnection,io.reactivex.Completable> sourceSupplier)
Generates aCompletable
fromSQLConnection
operations executed inside a transaction.- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aCompletable
generated by interacting with the givenSQLConnection
- Returns:
- a
Completable
generated fromSQLConnection
operations executed inside a transaction
-
usingConnectionFlowable
public static <T> io.reactivex.Flowable<T> usingConnectionFlowable(SQLClient client, Function<SQLConnection,io.reactivex.Flowable<T>> sourceSupplier)
Generates aFlowable
fromSQLConnection
operations.- Type Parameters:
T
- the type of the items emitted by theFlowable
- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aFlowable
generated by interacting with the givenSQLConnection
- Returns:
- a
Flowable
generated fromSQLConnection
operations
-
usingConnectionObservable
public static <T> io.reactivex.Observable<T> usingConnectionObservable(SQLClient client, Function<SQLConnection,io.reactivex.Observable<T>> sourceSupplier)
Generates aObservable
fromSQLConnection
operations.- Type Parameters:
T
- the type of the items emitted by theObservable
- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aObservable
generated by interacting with the givenSQLConnection
- Returns:
- an
Observable
generated fromSQLConnection
operations
-
usingConnectionSingle
public static <T> io.reactivex.Single<T> usingConnectionSingle(SQLClient client, Function<SQLConnection,io.reactivex.Single<T>> sourceSupplier)
Generates aSingle
fromSQLConnection
operations.- Type Parameters:
T
- the type of the item emitted by theSingle
- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aSingle
generated by interacting with the givenSQLConnection
- Returns:
- a
Single
generated fromSQLConnection
operations
-
usingConnectionMaybe
public static <T> io.reactivex.Maybe<T> usingConnectionMaybe(SQLClient client, Function<SQLConnection,io.reactivex.Maybe<T>> sourceSupplier)
Generates aMaybe
fromSQLConnection
operations.- Type Parameters:
T
- the type of the item emitted by theMaybe
- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aMaybe
generated by interacting with the givenSQLConnection
- Returns:
- a
Maybe
generated fromSQLConnection
operations
-
usingConnectionCompletable
public static io.reactivex.Completable usingConnectionCompletable(SQLClient client, Function<SQLConnection,io.reactivex.Completable> sourceSupplier)
Generates aCompletable
fromSQLConnection
operations.- Parameters:
client
- theSQLClient
sourceSupplier
- a user-provided function returning aCompletable
generated by interacting with the givenSQLConnection
- Returns:
- a
Completable
generated fromSQLConnection
operations
-
-