public static interface DatabaseProviderVertx.Builder
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
DatabaseProviderVertx |
create()
WARNING: You should try to avoid using this method.
|
void |
transact(DbCode code)
This is a convenience method to eliminate the need for explicitly
managing the resources (and error handling) for this class.
|
void |
transact(DbCodeTx code)
This is a convenience method to eliminate the need for explicitly
managing the resources (and error handling) for this class.
|
<T> void |
transactAsync(DbCodeTyped<T> code,
io.vertx.core.Handler<io.vertx.core.AsyncResult<T>> resultHandler) |
<T> void |
transactAsync(DbCodeTypedTx<T> code,
io.vertx.core.Handler<io.vertx.core.AsyncResult<T>> resultHandler) |
<T> T |
transactReturning(DbCodeTyped<T> code)
This method is the same as
transact(DbCode) but allows a return value. |
DatabaseProviderVertx.Builder |
withConnectionAccess()
Allow direct access to the underlying database connection.
|
DatabaseProviderVertx.Builder |
withDatePerAppOnly()
Wherever argDateNowPerDb() is specified, use argDateNowPerApp() instead.
|
DatabaseProviderVertx.Builder |
withOptions(OptionsOverride options) |
DatabaseProviderVertx.Builder |
withSqlInExceptionMessages()
Include SQL in exception messages.
|
DatabaseProviderVertx.Builder |
withSqlParameterLogging()
Enable logging of parameter values along with the SQL.
|
DatabaseProviderVertx.Builder |
withTransactionControl()
Allow provided Database instances to explicitly control transactions using the
commitNow() and rollbackNow() methods.
|
DatabaseProviderVertx.Builder |
withTransactionControlSilentlyIgnored()
This can be useful when testing code, as it can pretend to use transactions,
while giving you control over whether it actually commits or rolls back.
|
@CheckReturnValue DatabaseProviderVertx.Builder withOptions(OptionsOverride options)
@CheckReturnValue DatabaseProviderVertx.Builder withSqlParameterLogging()
@CheckReturnValue DatabaseProviderVertx.Builder withSqlInExceptionMessages()
@CheckReturnValue DatabaseProviderVertx.Builder withDatePerAppOnly()
@CheckReturnValue DatabaseProviderVertx.Builder withTransactionControl()
@CheckReturnValue DatabaseProviderVertx.Builder withTransactionControlSilentlyIgnored()
@CheckReturnValue DatabaseProviderVertx.Builder withConnectionAccess()
@CheckReturnValue DatabaseProviderVertx create()
If you use this method you are responsible for managing the transaction and commit/rollback/close.
void transact(DbCode code)
DbCode.run(Supplier) method threw a Throwable.
Here is a typical usage:
dbp.transact(dbs -> {
List r = dbs.get().toSelect("select a from b where c=?").argInteger(1).queryStrings();
});
code - the code you want to run as a transaction with a Databasetransact(DbCodeTx)<T> T transactReturning(DbCodeTyped<T> code)
transact(DbCode) but allows a return value.
Here is a typical usage:
Listr = dbp.transact(dbs -> { return dbs.get().toSelect("select a from b where c=?").argInteger(1).queryStrings(); });
<T> void transactAsync(DbCodeTyped<T> code, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>> resultHandler)
void transact(DbCodeTx code)
DbCodeTx.run(Supplier, Transaction) method threw a Throwable
while Transaction.isRollbackOnError() returns true, or
Transaction.isRollbackOnly() returns a true value.code - the code you want to run as a transaction with a Database<T> void transactAsync(DbCodeTypedTx<T> code, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>> resultHandler)
void close()
Copyright © 2020. All rights reserved.