
io.vertx.rxjava.ext.sql.SQLConnection Maven / Gradle / Ivy
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.rxjava.ext.sql;
import rx.Observable;
import rx.Single;
import io.vertx.rx.java.RxHelper;
import io.vertx.rx.java.WriteStreamSubscriber;
import io.vertx.rx.java.SingleOnSubscribeAdapter;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;
/**
* Represents a connection to a SQL database
*
*
* NOTE: This class has been automatically generated from the {@link io.vertx.ext.sql.SQLConnection original} non RX-ified interface using Vert.x codegen.
*/
@RxGen(io.vertx.ext.sql.SQLConnection.class)
public class SQLConnection implements io.vertx.rxjava.ext.sql.SQLOperations {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SQLConnection that = (SQLConnection) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final TypeArg __TYPE_ARG = new TypeArg<>( obj -> new SQLConnection((io.vertx.ext.sql.SQLConnection) obj),
SQLConnection::getDelegate
);
private final io.vertx.ext.sql.SQLConnection delegate;
public SQLConnection(io.vertx.ext.sql.SQLConnection delegate) {
this.delegate = delegate;
}
public SQLConnection(Object delegate) {
this.delegate = (io.vertx.ext.sql.SQLConnection)delegate;
}
public io.vertx.ext.sql.SQLConnection getDelegate() {
return delegate;
}
/**
* Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by
* getting a connection from the pool (this object) and return it back after the execution. Only the first result
* from the result set is returned.
* @param sql the statement to execute
* @param handler the result handler
* @return self
*/
public io.vertx.rxjava.ext.sql.SQLOperations querySingle(String sql, Handler> handler) {
delegate.querySingle(sql, handler);
return this;
}
/**
* Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by
* getting a connection from the pool (this object) and return it back after the execution. Only the first result
* from the result set is returned.
* @param sql the statement to execute
* @return self
* @deprecated use {@link #rxQuerySingle} instead
*/
@Deprecated()
public Observable querySingleObservable(String sql) {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
querySingle(sql, handler.toHandler());
return handler;
}
/**
* Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by
* getting a connection from the pool (this object) and return it back after the execution. Only the first result
* from the result set is returned.
* @param sql the statement to execute
* @return self
*/
public Single rxQuerySingle(String sql) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
querySingle(sql, fut);
}));
}
/**
* Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the
* boilerplate code by getting a connection from the pool (this object) and return it back after the execution.
* Only the first result from the result set is returned.
* @param sql the statement to execute
* @param arguments the arguments
* @param handler the result handler
* @return self
*/
public io.vertx.rxjava.ext.sql.SQLOperations querySingleWithParams(String sql, JsonArray arguments, Handler> handler) {
delegate.querySingleWithParams(sql, arguments, handler);
return this;
}
/**
* Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the
* boilerplate code by getting a connection from the pool (this object) and return it back after the execution.
* Only the first result from the result set is returned.
* @param sql the statement to execute
* @param arguments the arguments
* @return self
* @deprecated use {@link #rxQuerySingleWithParams} instead
*/
@Deprecated()
public Observable querySingleWithParamsObservable(String sql, JsonArray arguments) {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
querySingleWithParams(sql, arguments, handler.toHandler());
return handler;
}
/**
* Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the
* boilerplate code by getting a connection from the pool (this object) and return it back after the execution.
* Only the first result from the result set is returned.
* @param sql the statement to execute
* @param arguments the arguments
* @return self
*/
public Single rxQuerySingleWithParams(String sql, JsonArray arguments) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
querySingleWithParams(sql, arguments, fut);
}));
}
/**
* Sets the desired options to be applied to the current connection when statements are executed.
*
* The options are not applied globally but applicable to the current connection. For example changing the transaction
* isolation level will only affect statements run on this connection and not future or current connections acquired
* from the connection pool.
*
* This method is not async in nature since the apply will only happen at the moment a query is run.
* @param options the options to modify the unwrapped connection.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection setOptions(io.vertx.ext.sql.SQLOptions options) {
delegate.setOptions(options);
return this;
}
/**
* Sets the auto commit flag for this connection. True by default.
* @param autoCommit the autoCommit flag, true by default.
* @param resultHandler the handler which is called once this operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection setAutoCommit(boolean autoCommit, Handler> resultHandler) {
delegate.setAutoCommit(autoCommit, resultHandler);
return this;
}
/**
* Sets the auto commit flag for this connection. True by default.
* @param autoCommit the autoCommit flag, true by default.
* @return
* @deprecated use {@link #rxSetAutoCommit} instead
*/
@Deprecated()
public Observable setAutoCommitObservable(boolean autoCommit) {
io.vertx.rx.java.ObservableFuture resultHandler = io.vertx.rx.java.RxHelper.observableFuture();
setAutoCommit(autoCommit, resultHandler.toHandler());
return resultHandler;
}
/**
* Sets the auto commit flag for this connection. True by default.
* @param autoCommit the autoCommit flag, true by default.
* @return
*/
public Single rxSetAutoCommit(boolean autoCommit) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
setAutoCommit(autoCommit, fut);
}));
}
/**
* Executes the given SQL statement
* @param sql the SQL to execute. For example CREATE TABLE IF EXISTS table ...
* @param resultHandler the handler which is called once this operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection execute(String sql, Handler> resultHandler) {
delegate.execute(sql, resultHandler);
return this;
}
/**
* Executes the given SQL statement
* @param sql the SQL to execute. For example CREATE TABLE IF EXISTS table ...
* @return
* @deprecated use {@link #rxExecute} instead
*/
@Deprecated()
public Observable executeObservable(String sql) {
io.vertx.rx.java.ObservableFuture resultHandler = io.vertx.rx.java.RxHelper.observableFuture();
execute(sql, resultHandler.toHandler());
return resultHandler;
}
/**
* Executes the given SQL statement
* @param sql the SQL to execute. For example CREATE TABLE IF EXISTS table ...
* @return
*/
public Single rxExecute(String sql) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
execute(sql, fut);
}));
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @param resultHandler the handler which is called once the operation completes. It will return a ResultSet
.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection query(String sql, Handler> resultHandler) {
delegate.query(sql, resultHandler);
return this;
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @return
* @deprecated use {@link #rxQuery} instead
*/
@Deprecated()
public Observable queryObservable(String sql) {
io.vertx.rx.java.ObservableFuture resultHandler = io.vertx.rx.java.RxHelper.observableFuture();
query(sql, resultHandler.toHandler());
return resultHandler;
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @return
*/
public Single rxQuery(String sql) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
query(sql, fut);
}));
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query as a read stream.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @param handler the handler which is called once the operation completes. It will return a SQLRowStream
.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection queryStream(String sql, Handler> handler) {
delegate.queryStream(sql, new Handler>() {
public void handle(AsyncResult ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.ext.sql.SQLRowStream.newInstance((io.vertx.ext.sql.SQLRowStream)ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query as a read stream.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @return
* @deprecated use {@link #rxQueryStream} instead
*/
@Deprecated()
public Observable queryStreamObservable(String sql) {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
queryStream(sql, handler.toHandler());
return handler;
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query as a read stream.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @return
*/
public Single rxQueryStream(String sql) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
queryStream(sql, fut);
}));
}
/**
* Executes the given SQL SELECT
prepared statement which returns the results of the query.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @param params these are the parameters to fill the statement.
* @param resultHandler the handler which is called once the operation completes. It will return a ResultSet
.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection queryWithParams(String sql, JsonArray params, Handler> resultHandler) {
delegate.queryWithParams(sql, params, resultHandler);
return this;
}
/**
* Executes the given SQL SELECT
prepared statement which returns the results of the query.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @param params these are the parameters to fill the statement.
* @return
* @deprecated use {@link #rxQueryWithParams} instead
*/
@Deprecated()
public Observable queryWithParamsObservable(String sql, JsonArray params) {
io.vertx.rx.java.ObservableFuture resultHandler = io.vertx.rx.java.RxHelper.observableFuture();
queryWithParams(sql, params, resultHandler.toHandler());
return resultHandler;
}
/**
* Executes the given SQL SELECT
prepared statement which returns the results of the query.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @param params these are the parameters to fill the statement.
* @return
*/
public Single rxQueryWithParams(String sql, JsonArray params) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
queryWithParams(sql, params, fut);
}));
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query as a read stream.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @param params these are the parameters to fill the statement.
* @param handler the handler which is called once the operation completes. It will return a SQLRowStream
.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection queryStreamWithParams(String sql, JsonArray params, Handler> handler) {
delegate.queryStreamWithParams(sql, params, new Handler>() {
public void handle(AsyncResult ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.ext.sql.SQLRowStream.newInstance((io.vertx.ext.sql.SQLRowStream)ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query as a read stream.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @param params these are the parameters to fill the statement.
* @return
* @deprecated use {@link #rxQueryStreamWithParams} instead
*/
@Deprecated()
public Observable queryStreamWithParamsObservable(String sql, JsonArray params) {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
queryStreamWithParams(sql, params, handler.toHandler());
return handler;
}
/**
* Executes the given SQL SELECT
statement which returns the results of the query as a read stream.
* @param sql the SQL to execute. For example SELECT * FROM table ...
.
* @param params these are the parameters to fill the statement.
* @return
*/
public Single rxQueryStreamWithParams(String sql, JsonArray params) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
queryStreamWithParams(sql, params, fut);
}));
}
/**
* Executes the given SQL statement which may be an INSERT
, UPDATE
, or DELETE
* statement.
* @param sql the SQL to execute. For example INSERT INTO table ...
* @param resultHandler the handler which is called once the operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection update(String sql, Handler> resultHandler) {
delegate.update(sql, resultHandler);
return this;
}
/**
* Executes the given SQL statement which may be an INSERT
, UPDATE
, or DELETE
* statement.
* @param sql the SQL to execute. For example INSERT INTO table ...
* @return
* @deprecated use {@link #rxUpdate} instead
*/
@Deprecated()
public Observable updateObservable(String sql) {
io.vertx.rx.java.ObservableFuture resultHandler = io.vertx.rx.java.RxHelper.observableFuture();
update(sql, resultHandler.toHandler());
return resultHandler;
}
/**
* Executes the given SQL statement which may be an INSERT
, UPDATE
, or DELETE
* statement.
* @param sql the SQL to execute. For example INSERT INTO table ...
* @return
*/
public Single rxUpdate(String sql) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
update(sql, fut);
}));
}
/**
* Executes the given prepared statement which may be an INSERT
, UPDATE
, or DELETE
* statement with the given parameters
* @param sql the SQL to execute. For example INSERT INTO table ...
* @param params these are the parameters to fill the statement.
* @param resultHandler the handler which is called once the operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection updateWithParams(String sql, JsonArray params, Handler> resultHandler) {
delegate.updateWithParams(sql, params, resultHandler);
return this;
}
/**
* Executes the given prepared statement which may be an INSERT
, UPDATE
, or DELETE
* statement with the given parameters
* @param sql the SQL to execute. For example INSERT INTO table ...
* @param params these are the parameters to fill the statement.
* @return
* @deprecated use {@link #rxUpdateWithParams} instead
*/
@Deprecated()
public Observable updateWithParamsObservable(String sql, JsonArray params) {
io.vertx.rx.java.ObservableFuture resultHandler = io.vertx.rx.java.RxHelper.observableFuture();
updateWithParams(sql, params, resultHandler.toHandler());
return resultHandler;
}
/**
* Executes the given prepared statement which may be an INSERT
, UPDATE
, or DELETE
* statement with the given parameters
* @param sql the SQL to execute. For example INSERT INTO table ...
* @param params these are the parameters to fill the statement.
* @return
*/
public Single rxUpdateWithParams(String sql, JsonArray params) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
updateWithParams(sql, params, fut);
}));
}
/**
* Calls the given SQL PROCEDURE
which returns the result from the procedure.
* @param sql the SQL to execute. For example {call getEmpName}
.
* @param resultHandler the handler which is called once the operation completes. It will return a ResultSet
.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection call(String sql, Handler> resultHandler) {
delegate.call(sql, resultHandler);
return this;
}
/**
* Calls the given SQL PROCEDURE
which returns the result from the procedure.
* @param sql the SQL to execute. For example {call getEmpName}
.
* @return
* @deprecated use {@link #rxCall} instead
*/
@Deprecated()
public Observable callObservable(String sql) {
io.vertx.rx.java.ObservableFuture resultHandler = io.vertx.rx.java.RxHelper.observableFuture();
call(sql, resultHandler.toHandler());
return resultHandler;
}
/**
* Calls the given SQL PROCEDURE
which returns the result from the procedure.
* @param sql the SQL to execute. For example {call getEmpName}
.
* @return
*/
public Single rxCall(String sql) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
call(sql, fut);
}));
}
/**
* Calls the given SQL PROCEDURE
which returns the result from the procedure.
*
* The index of params and outputs are important for both arrays, for example when dealing with a prodecure that
* takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
*
*
* params = [VALUE1, VALUE2, null]
* outputs = [null, null, "VARCHAR"]
*
* @param sql the SQL to execute. For example {call getEmpName (?, ?)}
.
* @param params these are the parameters to fill the statement.
* @param outputs these are the outputs to fill the statement.
* @param resultHandler the handler which is called once the operation completes. It will return a ResultSet
.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection callWithParams(String sql, JsonArray params, JsonArray outputs, Handler> resultHandler) {
delegate.callWithParams(sql, params, outputs, resultHandler);
return this;
}
/**
* Calls the given SQL PROCEDURE
which returns the result from the procedure.
*
* The index of params and outputs are important for both arrays, for example when dealing with a prodecure that
* takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
*
*
* params = [VALUE1, VALUE2, null]
* outputs = [null, null, "VARCHAR"]
*
* @param sql the SQL to execute. For example {call getEmpName (?, ?)}
.
* @param params these are the parameters to fill the statement.
* @param outputs these are the outputs to fill the statement.
* @return
* @deprecated use {@link #rxCallWithParams} instead
*/
@Deprecated()
public Observable callWithParamsObservable(String sql, JsonArray params, JsonArray outputs) {
io.vertx.rx.java.ObservableFuture resultHandler = io.vertx.rx.java.RxHelper.observableFuture();
callWithParams(sql, params, outputs, resultHandler.toHandler());
return resultHandler;
}
/**
* Calls the given SQL PROCEDURE
which returns the result from the procedure.
*
* The index of params and outputs are important for both arrays, for example when dealing with a prodecure that
* takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
*
*
* params = [VALUE1, VALUE2, null]
* outputs = [null, null, "VARCHAR"]
*
* @param sql the SQL to execute. For example {call getEmpName (?, ?)}
.
* @param params these are the parameters to fill the statement.
* @param outputs these are the outputs to fill the statement.
* @return
*/
public Single rxCallWithParams(String sql, JsonArray params, JsonArray outputs) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
callWithParams(sql, params, outputs, fut);
}));
}
/**
* Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
* @param handler the handler called when this operation completes.
*/
public void close(Handler> handler) {
delegate.close(handler);
}
/**
* Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
* @return
* @deprecated use {@link #rxClose} instead
*/
@Deprecated()
public Observable closeObservable() {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
close(handler.toHandler());
return handler;
}
/**
* Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
* @return
*/
public Single rxClose() {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
close(fut);
}));
}
/**
* Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
*/
public void close() {
delegate.close();
}
/**
* Commits all changes made since the previous commit/rollback.
* @param handler the handler called when this operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection commit(Handler> handler) {
delegate.commit(handler);
return this;
}
/**
* Commits all changes made since the previous commit/rollback.
* @return
* @deprecated use {@link #rxCommit} instead
*/
@Deprecated()
public Observable commitObservable() {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
commit(handler.toHandler());
return handler;
}
/**
* Commits all changes made since the previous commit/rollback.
* @return
*/
public Single rxCommit() {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
commit(fut);
}));
}
/**
* Rolls back all changes made since the previous commit/rollback.
* @param handler the handler called when this operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection rollback(Handler> handler) {
delegate.rollback(handler);
return this;
}
/**
* Rolls back all changes made since the previous commit/rollback.
* @return
* @deprecated use {@link #rxRollback} instead
*/
@Deprecated()
public Observable rollbackObservable() {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
rollback(handler.toHandler());
return handler;
}
/**
* Rolls back all changes made since the previous commit/rollback.
* @return
*/
public Single rxRollback() {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
rollback(fut);
}));
}
/**
* Sets a connection wide query timeout.
*
* It can be over written at any time and becomes active on the next query call.
* @param timeoutInSeconds the max amount of seconds the query can take to execute.
* @return
*/
@Deprecated()
public io.vertx.rxjava.ext.sql.SQLConnection setQueryTimeout(int timeoutInSeconds) {
delegate.setQueryTimeout(timeoutInSeconds);
return this;
}
/**
* Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
* @param sqlStatements sql statement
* @param handler the result handler
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection batch(List sqlStatements, Handler>> handler) {
delegate.batch(sqlStatements, handler);
return this;
}
/**
* Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
* @param sqlStatements sql statement
* @return
* @deprecated use {@link #rxBatch} instead
*/
@Deprecated()
public Observable> batchObservable(List sqlStatements) {
io.vertx.rx.java.ObservableFuture> handler = io.vertx.rx.java.RxHelper.observableFuture();
batch(sqlStatements, handler.toHandler());
return handler;
}
/**
* Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
* @param sqlStatements sql statement
* @return
*/
public Single> rxBatch(List sqlStatements) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
batch(sqlStatements, fut);
}));
}
/**
* Batch a prepared statement with all entries from the args list. Each entry is a batch.
* The operation completes with the execution of the batch where the async result contains a array of Integers.
* @param sqlStatement sql statement
* @param args the prepared statement arguments
* @param handler the result handler
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection batchWithParams(String sqlStatement, List args, Handler>> handler) {
delegate.batchWithParams(sqlStatement, args, handler);
return this;
}
/**
* Batch a prepared statement with all entries from the args list. Each entry is a batch.
* The operation completes with the execution of the batch where the async result contains a array of Integers.
* @param sqlStatement sql statement
* @param args the prepared statement arguments
* @return
* @deprecated use {@link #rxBatchWithParams} instead
*/
@Deprecated()
public Observable> batchWithParamsObservable(String sqlStatement, List args) {
io.vertx.rx.java.ObservableFuture> handler = io.vertx.rx.java.RxHelper.observableFuture();
batchWithParams(sqlStatement, args, handler.toHandler());
return handler;
}
/**
* Batch a prepared statement with all entries from the args list. Each entry is a batch.
* The operation completes with the execution of the batch where the async result contains a array of Integers.
* @param sqlStatement sql statement
* @param args the prepared statement arguments
* @return
*/
public Single> rxBatchWithParams(String sqlStatement, List args) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
batchWithParams(sqlStatement, args, fut);
}));
}
/**
* Batch a callable statement with all entries from the args list. Each entry is a batch.
* The size of the lists inArgs and outArgs MUST be the equal.
* The operation completes with the execution of the batch where the async result contains a array of Integers.
* @param sqlStatement sql statement
* @param inArgs the callable statement input arguments
* @param outArgs the callable statement output arguments
* @param handler the result handler
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection batchCallableWithParams(String sqlStatement, List inArgs, List outArgs, Handler>> handler) {
delegate.batchCallableWithParams(sqlStatement, inArgs, outArgs, handler);
return this;
}
/**
* Batch a callable statement with all entries from the args list. Each entry is a batch.
* The size of the lists inArgs and outArgs MUST be the equal.
* The operation completes with the execution of the batch where the async result contains a array of Integers.
* @param sqlStatement sql statement
* @param inArgs the callable statement input arguments
* @param outArgs the callable statement output arguments
* @return
* @deprecated use {@link #rxBatchCallableWithParams} instead
*/
@Deprecated()
public Observable> batchCallableWithParamsObservable(String sqlStatement, List inArgs, List outArgs) {
io.vertx.rx.java.ObservableFuture> handler = io.vertx.rx.java.RxHelper.observableFuture();
batchCallableWithParams(sqlStatement, inArgs, outArgs, handler.toHandler());
return handler;
}
/**
* Batch a callable statement with all entries from the args list. Each entry is a batch.
* The size of the lists inArgs and outArgs MUST be the equal.
* The operation completes with the execution of the batch where the async result contains a array of Integers.
* @param sqlStatement sql statement
* @param inArgs the callable statement input arguments
* @param outArgs the callable statement output arguments
* @return
*/
public Single> rxBatchCallableWithParams(String sqlStatement, List inArgs, List outArgs) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
batchCallableWithParams(sqlStatement, inArgs, outArgs, fut);
}));
}
/**
* Attempts to change the transaction isolation level for this Connection object to the one given.
*
* The constants defined in the interface Connection are the possible transaction isolation levels.
* @param isolation the level of isolation
* @param handler the handler called when this operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection setTransactionIsolation(io.vertx.ext.sql.TransactionIsolation isolation, Handler> handler) {
delegate.setTransactionIsolation(isolation, handler);
return this;
}
/**
* Attempts to change the transaction isolation level for this Connection object to the one given.
*
* The constants defined in the interface Connection are the possible transaction isolation levels.
* @param isolation the level of isolation
* @return
* @deprecated use {@link #rxSetTransactionIsolation} instead
*/
@Deprecated()
public Observable setTransactionIsolationObservable(io.vertx.ext.sql.TransactionIsolation isolation) {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
setTransactionIsolation(isolation, handler.toHandler());
return handler;
}
/**
* Attempts to change the transaction isolation level for this Connection object to the one given.
*
* The constants defined in the interface Connection are the possible transaction isolation levels.
* @param isolation the level of isolation
* @return
*/
public Single rxSetTransactionIsolation(io.vertx.ext.sql.TransactionIsolation isolation) {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
setTransactionIsolation(isolation, fut);
}));
}
/**
* Attempts to return the transaction isolation level for this Connection object to the one given.
* @param handler the handler called when this operation completes.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection getTransactionIsolation(Handler> handler) {
delegate.getTransactionIsolation(handler);
return this;
}
/**
* Attempts to return the transaction isolation level for this Connection object to the one given.
* @return
* @deprecated use {@link #rxGetTransactionIsolation} instead
*/
@Deprecated()
public Observable getTransactionIsolationObservable() {
io.vertx.rx.java.ObservableFuture handler = io.vertx.rx.java.RxHelper.observableFuture();
getTransactionIsolation(handler.toHandler());
return handler;
}
/**
* Attempts to return the transaction isolation level for this Connection object to the one given.
* @return
*/
public Single rxGetTransactionIsolation() {
return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> {
getTransactionIsolation(fut);
}));
}
public static SQLConnection newInstance(io.vertx.ext.sql.SQLConnection arg) {
return arg != null ? new SQLConnection(arg) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy