public static interface DatabaseProvider.Builder
| Modifier and Type | Method and Description |
|---|---|
DatabaseProvider |
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.
|
void |
transact(DbRun run)
Deprecated.
Replace with
transact(DbCodeTx) and a call to
Transaction.setRollbackOnError(boolean)
providing a value of false. |
DatabaseProvider.Builder |
withConnectionAccess()
Allow direct access to the underlying database connection.
|
DatabaseProvider.Builder |
withDatePerAppOnly()
Wherever argDateNowPerDb() is specified, use argDateNowPerApp() instead.
|
DatabaseProvider.Builder |
withOptions(OptionsOverride options) |
DatabaseProvider.Builder |
withSqlInExceptionMessages()
Include SQL in exception messages.
|
DatabaseProvider.Builder |
withSqlParameterLogging()
Enable logging of parameter values along with the SQL.
|
DatabaseProvider.Builder |
withTransactionControl()
Allow provided Database instances to explicitly control transactions using the
commitNow() and rollbackNow() methods.
|
DatabaseProvider.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 DatabaseProvider.Builder withOptions(OptionsOverride options)
@CheckReturnValue DatabaseProvider.Builder withSqlParameterLogging()
@CheckReturnValue DatabaseProvider.Builder withSqlInExceptionMessages()
@CheckReturnValue DatabaseProvider.Builder withDatePerAppOnly()
@CheckReturnValue DatabaseProvider.Builder withTransactionControl()
@CheckReturnValue DatabaseProvider.Builder withTransactionControlSilentlyIgnored()
@CheckReturnValue DatabaseProvider.Builder withConnectionAccess()
@CheckReturnValue DatabaseProvider create()
If you use this method you are responsible for managing the transaction and commit/rollback/close.
@Deprecated void transact(DbRun run)
transact(DbCodeTx) and a call to
Transaction.setRollbackOnError(boolean)
providing a value of false.void transact(DbCode code)
DbCode.run(Supplier) method threw a Throwable.code - the code you want to run as a transaction with a Database#transact(DbCodeTx)} if you want to explicitly manage
when the transaction commits or rolls backvoid 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 DatabaseCopyright © 2016. All rights reserved.