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.CompletableinTransactionCompletable(SQLClient client, Function<SQLConnection,io.reactivex.Completable> sourceSupplier)Generates aCompletablefromSQLConnectionoperations executed inside a transaction.static <T> io.reactivex.Flowable<T>inTransactionFlowable(SQLClient client, Function<SQLConnection,io.reactivex.Flowable<T>> sourceSupplier)Generates aFlowablefromSQLConnectionoperations executed inside a transaction.static <T> io.reactivex.Maybe<T>inTransactionMaybe(SQLClient client, Function<SQLConnection,io.reactivex.Maybe<T>> sourceSupplier)Generates aMaybefromSQLConnectionoperations executed inside a transaction.static <T> io.reactivex.Observable<T>inTransactionObservable(SQLClient client, Function<SQLConnection,io.reactivex.Observable<T>> sourceSupplier)Generates aObservablefromSQLConnectionoperations executed inside a transaction.static <T> io.reactivex.Single<T>inTransactionSingle(SQLClient client, Function<SQLConnection,io.reactivex.Single<T>> sourceSupplier)Generates aSinglefromSQLConnectionoperations executed inside a transaction.static io.reactivex.CompletableTransformertxCompletableTransformer(SQLConnection sqlConnection)Creates aCompletableTransformerdecorating aCompletablewith transaction management for a givenSQLConnection.static <T> io.reactivex.FlowableTransformer<T,T>txFlowableTransformer(SQLConnection sqlConnection)Creates aFlowableTransformerdecorating aFlowablewith transaction management for a givenSQLConnection.static <T> io.reactivex.MaybeTransformer<T,T>txMaybeTransformer(SQLConnection sqlConnection)Creates aMaybeTransformerdecorating aMaybewith transaction management for a givenSQLConnection.static <T> io.reactivex.ObservableTransformer<T,T>txObservableTransformer(SQLConnection sqlConnection)Creates aObservableTransformerdecorating anObservablewith transaction management for a givenSQLConnection.static <T> io.reactivex.SingleTransformer<T,T>txSingleTransformer(SQLConnection sqlConnection)Creates aSingleTransformerdecorating aSinglewith transaction management for a givenSQLConnection.static io.reactivex.CompletableusingConnectionCompletable(SQLClient client, Function<SQLConnection,io.reactivex.Completable> sourceSupplier)Generates aCompletablefromSQLConnectionoperations.static <T> io.reactivex.Flowable<T>usingConnectionFlowable(SQLClient client, Function<SQLConnection,io.reactivex.Flowable<T>> sourceSupplier)Generates aFlowablefromSQLConnectionoperations.static <T> io.reactivex.Maybe<T>usingConnectionMaybe(SQLClient client, Function<SQLConnection,io.reactivex.Maybe<T>> sourceSupplier)Generates aMaybefromSQLConnectionoperations.static <T> io.reactivex.Observable<T>usingConnectionObservable(SQLClient client, Function<SQLConnection,io.reactivex.Observable<T>> sourceSupplier)Generates aObservablefromSQLConnectionoperations.static <T> io.reactivex.Single<T>usingConnectionSingle(SQLClient client, Function<SQLConnection,io.reactivex.Single<T>> sourceSupplier)Generates aSinglefromSQLConnectionoperations.
-
-
-
Method Detail
-
txFlowableTransformer
public static <T> io.reactivex.FlowableTransformer<T,T> txFlowableTransformer(SQLConnection sqlConnection)
Creates aFlowableTransformerdecorating aFlowablewith transaction management for a givenSQLConnection.If the upstream
Flowablecompletes (onComplete), the transaction is committed. If the upstreamFlowableemits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnectionis put back in autocommit mode.- Type Parameters:
T- the type of the items emitted by the upstreamFlowable- Parameters:
sqlConnection- theSQLConnectionused for database operations and transaction management- Returns:
- a
FlowableTransformerdecorating aFlowablewith transaction management
-
inTransactionFlowable
public static <T> io.reactivex.Flowable<T> inTransactionFlowable(SQLClient client, Function<SQLConnection,io.reactivex.Flowable<T>> sourceSupplier)
Generates aFlowablefromSQLConnectionoperations executed inside a transaction.- Type Parameters:
T- the type of the items emitted by theFlowable- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aFlowablegenerated by interacting with the givenSQLConnection- Returns:
- a
Flowablegenerated fromSQLConnectionoperations executed inside a transaction
-
txObservableTransformer
public static <T> io.reactivex.ObservableTransformer<T,T> txObservableTransformer(SQLConnection sqlConnection)
Creates aObservableTransformerdecorating anObservablewith transaction management for a givenSQLConnection.If the upstream
Observablecompletes (onComplete), the transaction is committed. If the upstreamObservableemits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnectionis put back in autocommit mode.- Type Parameters:
T- the type of the items emitted by the upstreamObservable- Parameters:
sqlConnection- theSQLConnectionused for database operations and transaction management- Returns:
- a
ObservableTransformerdecorating anObservablewith transaction management
-
inTransactionObservable
public static <T> io.reactivex.Observable<T> inTransactionObservable(SQLClient client, Function<SQLConnection,io.reactivex.Observable<T>> sourceSupplier)
Generates aObservablefromSQLConnectionoperations executed inside a transaction.- Type Parameters:
T- the type of the items emitted by theObservable- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aObservablegenerated by interacting with the givenSQLConnection- Returns:
- an
Observablegenerated fromSQLConnectionoperations executed inside a transaction
-
txSingleTransformer
public static <T> io.reactivex.SingleTransformer<T,T> txSingleTransformer(SQLConnection sqlConnection)
Creates aSingleTransformerdecorating aSinglewith transaction management for a givenSQLConnection.If the upstream
Singleemits a value (onSuccess), the transaction is committed. If the upstreamSingleemits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnectionis put back in autocommit mode.- Type Parameters:
T- the type of the item emitted by the upstreamSingle- Parameters:
sqlConnection- theSQLConnectionused for database operations and transaction management- Returns:
- a
SingleTransformerdecorating aSinglewith transaction management
-
inTransactionSingle
public static <T> io.reactivex.Single<T> inTransactionSingle(SQLClient client, Function<SQLConnection,io.reactivex.Single<T>> sourceSupplier)
Generates aSinglefromSQLConnectionoperations executed inside a transaction.- Type Parameters:
T- the type of the item emitted by theSingle- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aSinglegenerated by interacting with the givenSQLConnection- Returns:
- a
Singlegenerated fromSQLConnectionoperations executed inside a transaction
-
txMaybeTransformer
public static <T> io.reactivex.MaybeTransformer<T,T> txMaybeTransformer(SQLConnection sqlConnection)
Creates aMaybeTransformerdecorating aMaybewith transaction management for a givenSQLConnection.If the upstream
Maybeemits a value (onSuccess) or completes (onComplete), the transaction is committed. If the upstreamMaybeemits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnectionis put back in autocommit mode.- Type Parameters:
T- the type of the item emitted by the upstreamMaybe- Parameters:
sqlConnection- theSQLConnectionused for database operations and transaction management- Returns:
- a
MaybeTransformerdecorating aMaybewith transaction management
-
inTransactionMaybe
public static <T> io.reactivex.Maybe<T> inTransactionMaybe(SQLClient client, Function<SQLConnection,io.reactivex.Maybe<T>> sourceSupplier)
Generates aMaybefromSQLConnectionoperations executed inside a transaction.- Type Parameters:
T- the type of the item emitted by theMaybe- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aMaybegenerated by interacting with the givenSQLConnection- Returns:
- a
Maybegenerated fromSQLConnectionoperations executed inside a transaction
-
txCompletableTransformer
public static io.reactivex.CompletableTransformer txCompletableTransformer(SQLConnection sqlConnection)
Creates aCompletableTransformerdecorating aCompletablewith transaction management for a givenSQLConnection.If the upstream
Completablecompletes (onComplete), the transaction is committed. If the upstreamCompletableemits an error (onError), the transaction is rollbacked.Eventually, the given
SQLConnectionis put back in autocommit mode.- Parameters:
sqlConnection- theSQLConnectionused for database operations and transaction management- Returns:
- a
CompletableTransformerdecorating aCompletablewith transaction management
-
inTransactionCompletable
public static io.reactivex.Completable inTransactionCompletable(SQLClient client, Function<SQLConnection,io.reactivex.Completable> sourceSupplier)
Generates aCompletablefromSQLConnectionoperations executed inside a transaction.- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aCompletablegenerated by interacting with the givenSQLConnection- Returns:
- a
Completablegenerated fromSQLConnectionoperations executed inside a transaction
-
usingConnectionFlowable
public static <T> io.reactivex.Flowable<T> usingConnectionFlowable(SQLClient client, Function<SQLConnection,io.reactivex.Flowable<T>> sourceSupplier)
Generates aFlowablefromSQLConnectionoperations.- Type Parameters:
T- the type of the items emitted by theFlowable- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aFlowablegenerated by interacting with the givenSQLConnection- Returns:
- a
Flowablegenerated fromSQLConnectionoperations
-
usingConnectionObservable
public static <T> io.reactivex.Observable<T> usingConnectionObservable(SQLClient client, Function<SQLConnection,io.reactivex.Observable<T>> sourceSupplier)
Generates aObservablefromSQLConnectionoperations.- Type Parameters:
T- the type of the items emitted by theObservable- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aObservablegenerated by interacting with the givenSQLConnection- Returns:
- an
Observablegenerated fromSQLConnectionoperations
-
usingConnectionSingle
public static <T> io.reactivex.Single<T> usingConnectionSingle(SQLClient client, Function<SQLConnection,io.reactivex.Single<T>> sourceSupplier)
Generates aSinglefromSQLConnectionoperations.- Type Parameters:
T- the type of the item emitted by theSingle- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aSinglegenerated by interacting with the givenSQLConnection- Returns:
- a
Singlegenerated fromSQLConnectionoperations
-
usingConnectionMaybe
public static <T> io.reactivex.Maybe<T> usingConnectionMaybe(SQLClient client, Function<SQLConnection,io.reactivex.Maybe<T>> sourceSupplier)
Generates aMaybefromSQLConnectionoperations.- Type Parameters:
T- the type of the item emitted by theMaybe- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aMaybegenerated by interacting with the givenSQLConnection- Returns:
- a
Maybegenerated fromSQLConnectionoperations
-
usingConnectionCompletable
public static io.reactivex.Completable usingConnectionCompletable(SQLClient client, Function<SQLConnection,io.reactivex.Completable> sourceSupplier)
Generates aCompletablefromSQLConnectionoperations.- Parameters:
client- theSQLClientsourceSupplier- a user-provided function returning aCompletablegenerated by interacting with the givenSQLConnection- Returns:
- a
Completablegenerated fromSQLConnectionoperations
-
-