public class MockConfiguration extends java.lang.Object implements Configuration
This Configuration wraps a delegate Configuration and
wraps all ConnectionProvider references in
MockConnectionProvider.
| Constructor and Description |
|---|
MockConfiguration(Configuration delegate,
MockDataProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
java.time.Clock |
clock()
Get this configuration's
Clock, which is used for optimistic
locking, transaction time, and other time-depending features. |
ConnectionProvider |
connectionProvider()
Get this configuration's underlying connection provider.
|
ConverterProvider |
converterProvider()
Get the configured
ConverterProvider from this
configuration. |
java.util.Map<java.lang.Object,java.lang.Object> |
data()
Get all custom data from this
Configuration. |
java.lang.Object |
data(java.lang.Object key)
Get some custom data from this
Configuration. |
java.lang.Object |
data(java.lang.Object key,
java.lang.Object value)
Set some custom data to this
Configuration. |
Configuration |
derive()
Create a derived configuration from this one, without changing any
properties.
|
Configuration |
derive(java.time.Clock newClock)
Create a derived configuration from this one, with a new
Clock. |
Configuration |
derive(java.sql.Connection newConnection)
Create a derived configuration from this one, with a new connection
wrapped in a
DefaultConnectionProvider. |
Configuration |
derive(ConnectionProvider newConnectionProvider)
Create a derived configuration from this one, with a new connection
provider.
|
Configuration |
derive(ConverterProvider newConverterProvider)
Create a derived configuration from this one, with new converter
provider.
|
Configuration |
derive(javax.sql.DataSource newDataSource)
Create a derived configuration from this one, with a new data source
wrapped in a
DataSourceConnectionProvider. |
Configuration |
derive(ExecuteListener... newExecuteListeners)
Create a derived configuration from this one, with new execute listeners.
|
Configuration |
derive(ExecuteListenerProvider... newExecuteListenerProviders)
Create a derived configuration from this one, with new execute listener
providers.
|
Configuration |
derive(java.util.concurrent.Executor newExecutor)
Create a derived configuration from this one, with a new executor.
|
Configuration |
derive(ExecutorProvider newExecutorProvider)
Create a derived configuration from this one, with a new executor
provider.
|
Configuration |
derive(RecordListener... newRecordListeners)
Create a derived configuration from this one, with new record listeners.
|
Configuration |
derive(RecordListenerProvider... newRecordListenerProviders)
Create a derived configuration from this one, with new record listener
providers.
|
Configuration |
derive(RecordMapper<?,?> newRecordMapper)
Create a derived configuration from this one, with a new record mapper.
|
Configuration |
derive(RecordMapperProvider newRecordMapperProvider)
Create a derived configuration from this one, with a new record mapper
provider.
|
Configuration |
derive(RecordUnmapper<?,?> newRecordUnmapper)
Create a derived configuration from this one, with a new record unmapper.
|
Configuration |
derive(RecordUnmapperProvider newRecordUnmapperProvider)
Create a derived configuration from this one, with a new record unmapper
provider.
|
Configuration |
derive(Settings newSettings)
Create a derived configuration from this one, with new settings.
|
Configuration |
derive(SQLDialect newDialect)
Create a derived configuration from this one, with a new dialect.
|
Configuration |
derive(TransactionListener... newTransactionListeners)
Create a derived configuration from this one, with new transaction
listeners.
|
Configuration |
derive(TransactionListenerProvider... newTransactionListenerProviders)
Create a derived configuration from this one, with new transaction
listener providers.
|
Configuration |
derive(TransactionProvider newTransactionProvider)
Create a derived configuration from this one, with a new transaction
provider.
|
Configuration |
derive(VisitListener... newVisitListeners)
Create a derived configuration from this one, with new visit listeners.
|
Configuration |
derive(VisitListenerProvider... newVisitListenerProviders)
Create a derived configuration from this one, with new visit listener
providers.
|
SQLDialect |
dialect()
Retrieve the configured dialect.
|
DSLContext |
dsl()
Wrap this
Configuration in a DSLContext, providing
access to the configuration-contextual DSL to construct executable
queries. |
ExecuteListenerProvider[] |
executeListenerProviders()
Get the configured
ExecuteListenerProviders from this
configuration. |
ExecutorProvider |
executorProvider()
Get this configuration's underlying executor provider.
|
SQLDialect |
family()
Retrieve the family of the configured dialect.
|
RecordListenerProvider[] |
recordListenerProviders()
Get the configured
RecordListenerProviders from this
configuration. |
RecordMapperProvider |
recordMapperProvider()
Get this configuration's underlying record mapper provider.
|
RecordUnmapperProvider |
recordUnmapperProvider()
Get this configuration's underlying record unmapper provider.
|
SchemaMapping |
schemaMapping()
Retrieve the configured schema mapping.
|
Configuration |
set(java.time.Clock newClock)
Change this configuration to hold a new
Clock. |
Configuration |
set(java.sql.Connection newConnection)
Change this configuration to hold a new connection wrapped in a
DefaultConnectionProvider. |
Configuration |
set(ConnectionProvider newConnectionProvider)
Change this configuration to hold a new connection provider.
|
Configuration |
set(ConverterProvider newConverterProvider)
Change this configuration to hold a new converter provider.
|
Configuration |
set(javax.sql.DataSource newDataSource)
Change this configuration to hold a new data source wrapped in a
DataSourceConnectionProvider. |
Configuration |
set(ExecuteListener... newExecuteListeners)
Change this configuration to hold a new execute listeners.
|
Configuration |
set(ExecuteListenerProvider... newExecuteListenerProviders)
Change this configuration to hold a new execute listener providers.
|
Configuration |
set(java.util.concurrent.Executor newExecutor)
Change this configuration to hold a new executor.
|
Configuration |
set(ExecutorProvider newExecutorProvider)
Change this configuration to hold a new executor provider.
|
Configuration |
set(RecordListener... newRecordListeners)
Change this configuration to hold a new record listeners.
|
Configuration |
set(RecordListenerProvider... newRecordListenerProviders)
Change this configuration to hold a new record listener providers.
|
Configuration |
set(RecordMapper<?,?> newRecordMapper)
Change this configuration to hold a new record mapper.
|
Configuration |
set(RecordMapperProvider newRecordMapperProvider)
Change this configuration to hold a new record mapper provider.
|
Configuration |
set(RecordUnmapper<?,?> newRecordUnmapper)
Change this configuration to hold a new record unmapper.
|
Configuration |
set(RecordUnmapperProvider newRecordUnmapperProvider)
Change this configuration to hold a new record unmapper provider.
|
Configuration |
set(Settings newSettings)
Change this configuration to hold a new settings.
|
Configuration |
set(SQLDialect newDialect)
Change this configuration to hold a new dialect.
|
Configuration |
set(TransactionListener... newTransactionListeners)
Change this configuration to hold a new transaction listeners.
|
Configuration |
set(TransactionListenerProvider... newTransactionListenerProviders)
Change this configuration to hold a new transaction listener providers.
|
Configuration |
set(TransactionProvider newTransactionProvider)
Change this configuration to hold a new transaction provider.
|
Configuration |
set(VisitListener... newVisitListeners)
Change this configuration to hold a new visit listeners.
|
Configuration |
set(VisitListenerProvider... newVisitListenerProviders)
Change this configuration to hold a new visit listener providers.
|
Settings |
settings()
Retrieve the runtime configuration settings.
|
TransactionListenerProvider[] |
transactionListenerProviders()
Get the configured
TransactionListenerProviders from this
configuration. |
TransactionProvider |
transactionProvider()
Get this configuration's underlying transaction provider.
|
VisitListenerProvider[] |
visitListenerProviders()
TODO [#2667]
|
public MockConfiguration(Configuration delegate, MockDataProvider provider)
public DSLContext dsl()
ConfigurationConfiguration in a DSLContext, providing
access to the configuration-contextual DSL to construct executable
queries.dsl in interface Configurationpublic java.util.Map<java.lang.Object,java.lang.Object> data()
ConfigurationConfiguration.
This is custom data that was previously set to the configuration using
Configuration.data(Object, Object). Use custom data if you want to pass data
to your custom QueryPart or ExecuteListener objects to be
made available at render, bind, execution, fetch time.
See ExecuteListener for more details.
data in interface ConfigurationnullExecuteListenerpublic java.lang.Object data(java.lang.Object key)
ConfigurationConfiguration.
This is custom data that was previously set to the configuration using
Configuration.data(Object, Object). Use custom data if you want to pass data
to your custom QueryPart or ExecuteListener objects to be
made available at render, bind, execution, fetch time.
See ExecuteListener for more details.
data in interface Configurationkey - A key to identify the custom datanull if no such data is contained
in this ConfigurationExecuteListenerpublic java.lang.Object data(java.lang.Object key,
java.lang.Object value)
ConfigurationConfiguration.
Use custom data if you want to pass data to your custom QueryPart
or ExecuteListener objects to be made available at render, bind,
execution, fetch time.
Be sure that your custom data implements Serializable if you want
to serialise this Configuration or objects referencing this
Configuration, e.g. your Record types.
See ExecuteListener for more details.
data in interface Configurationkey - A key to identify the custom datavalue - The custom datanull if no data
was previously set for the given keyExecuteListenerpublic java.time.Clock clock()
ConfigurationClock, which is used for optimistic
locking, transaction time, and other time-depending features.clock in interface Configurationpublic ConnectionProvider connectionProvider()
ConfigurationconnectionProvider in interface Configurationpublic ExecutorProvider executorProvider()
Configuration
Asynchronous operations will call back to this SPI to obtain an executor.
This applies, for example, to ResultQuery.fetchAsync().
The following logic is applied when resolving the appropriate
executor:
Configuration.executorProvider() does not return
null, then ExecutorProvider.provide() is called to
obtain an Executor for the asynchronous task.ForkJoinPool.commonPool() is
used if ForkJoinPool.getCommonPoolParallelism() > 1
Executor is used in any
other case.
The SPI will not be called if an asynchronous operation explicitly
overrides the Executor, e.g. as is the case for
ResultQuery.fetchAsync(Executor).
executorProvider in interface Configurationpublic TransactionProvider transactionProvider()
Configuration
If no explicit transaction provider was specified, and if
Configuration.connectionProvider() is a DefaultConnectionProvider,
then this will return a DefaultTransactionProvider.
transactionProvider in interface Configurationpublic RecordMapperProvider recordMapperProvider()
ConfigurationrecordMapperProvider in interface Configurationpublic RecordUnmapperProvider recordUnmapperProvider()
ConfigurationrecordUnmapperProvider in interface Configurationpublic RecordListenerProvider[] recordListenerProviders()
ConfigurationRecordListenerProviders from this
configuration.
This method allows for retrieving the configured
RecordListenerProvider from this configuration. The
providers will provide jOOQ with RecordListener instances. These
instances receive record manipulation notification events every time jOOQ
executes queries. jOOQ makes no assumptions about the internal state of
these listeners, i.e. listener instances may
Configuration's lifecycle (i.e. that of a
JDBC Connection, or that of a transaction)RecordContext (i.e. that of a
single record manipulation)recordListenerProviders in interface ConfigurationRecordListenerProvider,
RecordListener,
RecordContextpublic ExecuteListenerProvider[] executeListenerProviders()
ConfigurationExecuteListenerProviders from this
configuration.
This method allows for retrieving the configured
ExecuteListenerProvider from this configuration. The
providers will provide jOOQ with ExecuteListener instances. These
instances receive execution lifecycle notification events every time jOOQ
executes queries. jOOQ makes no assumptions about the internal state of
these listeners, i.e. listener instances may
Configuration's lifecycle (i.e. that of a
JDBC Connection, or that of a transaction)ExecuteContext (i.e. that of a
single query execution)
Note, depending on your Settings.isExecuteLogging(), some
additional listeners may be prepended to this list, internally. Those
listeners will never be exposed through this method, though.
executeListenerProviders in interface ConfigurationExecuteListenerProvider,
ExecuteListener,
ExecuteContextpublic VisitListenerProvider[] visitListenerProviders()
ConfigurationvisitListenerProviders in interface Configurationpublic TransactionListenerProvider[] transactionListenerProviders()
ConfigurationTransactionListenerProviders from this
configuration.transactionListenerProviders in interface Configurationpublic ConverterProvider converterProvider()
ConfigurationConverterProvider from this
configuration.converterProvider in interface Configurationpublic SchemaMapping schemaMapping()
ConfigurationschemaMapping in interface Configurationpublic SQLDialect dialect()
Configurationdialect in interface Configurationpublic SQLDialect family()
Configurationfamily in interface Configurationpublic Settings settings()
Configurationsettings in interface Configurationpublic Configuration set(java.time.Clock newClock)
ConfigurationClock.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewClock - The new clock to be contained in the changed
configuration.public Configuration set(ConnectionProvider newConnectionProvider)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewConnectionProvider - The new connection provider to be contained
in the changed configuration.public Configuration set(java.sql.Connection newConnection)
ConfigurationDefaultConnectionProvider.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewConnection - The new connection to be contained in the changed
configuration.public Configuration set(javax.sql.DataSource newDataSource)
ConfigurationDataSourceConnectionProvider.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewDataSource - The new data source to be contained in the changed
configuration.public Configuration set(java.util.concurrent.Executor newExecutor)
Configuration
This will wrap the argument Executor in a
DefaultExecutorProvider for convenience.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewExecutor - The new executor to be contained in the changed
configuration.public Configuration set(ExecutorProvider newExecutorProvider)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewExecutorProvider - The new executor provider to be contained in
the changed configuration.public Configuration set(TransactionProvider newTransactionProvider)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewTransactionProvider - The new transaction provider to be
contained in the changed configuration.public Configuration set(RecordMapper<?,?> newRecordMapper)
Configuration
This will wrap the argument RecordMapper in a
DefaultRecordMapperProvider for convenience.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewRecordMapper - The new record mapper to be contained in the
changed configuration.public Configuration set(RecordMapperProvider newRecordMapperProvider)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewRecordMapperProvider - The new record mapper provider to be
contained in the changed configuration.public Configuration set(RecordUnmapper<?,?> newRecordUnmapper)
Configuration
This will wrap the argument RecordUnmapper in a
DefaultRecordUnmapperProvider for convenience.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewRecordUnmapper - The new record unmapper to be contained in the
changed configuration.public Configuration set(RecordUnmapperProvider newRecordUnmapperProvider)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewRecordUnmapperProvider - The new record unmapper provider to be
contained in the changed configuration.public Configuration set(RecordListener... newRecordListeners)
Configuration
This will wrap the argument RecordListener in a
DefaultRecordListenerProvider for convenience.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewRecordListeners - The new record listener to be contained
in the changed configuration.public Configuration set(RecordListenerProvider... newRecordListenerProviders)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewRecordListenerProviders - The new record listener providers to
be contained in the changed configuration.public Configuration set(ExecuteListener... newExecuteListeners)
Configuration
This will wrap the argument ExecuteListener in a
DefaultExecuteListenerProvider for convenience.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewExecuteListeners - The new execute listeners to be contained in
the changed configuration.public Configuration set(ExecuteListenerProvider... newExecuteListenerProviders)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewExecuteListenerProviders - The new execute listener providers to
be contained in the changed configuration.public Configuration set(VisitListener... newVisitListeners)
Configuration
This will wrap the argument VisitListener in a
DefaultVisitListenerProvider for convenience.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewVisitListeners - The new visit listeners to be contained
in the changed configuration.public Configuration set(VisitListenerProvider... newVisitListenerProviders)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewVisitListenerProviders - The new visit listener providers to
be contained in the changed configuration.public Configuration set(TransactionListener... newTransactionListeners)
Configuration
This will wrap the argument TransactionListener in a
DefaultTransactionListenerProvider for convenience.
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewTransactionListeners - The new transaction listeners to be
contained in the changed configuration.public Configuration set(TransactionListenerProvider... newTransactionListenerProviders)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewTransactionListenerProviders - The new transaction listener
providers to be contained in the changed configuration.public Configuration set(ConverterProvider newConverterProvider)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewConverterProvider - The new converter provider to be contained in
the changed configuration.public Configuration set(SQLDialect newDialect)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewDialect - The new dialect to be contained in the changed
configuration.public Configuration set(Settings newSettings)
Configuration
This method is not thread-safe and should not be used in globally
available Configuration objects.
set in interface ConfigurationnewSettings - The new settings to be contained in the changed
configuration.public Configuration derive()
Configurationderive in interface Configurationpublic Configuration derive(java.time.Clock newClock)
ConfigurationClock.derive in interface ConfigurationnewClock - The new clock to be contained in the derived
configuration.public Configuration derive(java.sql.Connection newConnection)
ConfigurationDefaultConnectionProvider.derive in interface ConfigurationnewConnection - The new connection to be contained in the derived
configuration.public Configuration derive(javax.sql.DataSource newDataSource)
ConfigurationDataSourceConnectionProvider.derive in interface ConfigurationnewDataSource - The new data source to be contained in the derived
configuration.public Configuration derive(ConnectionProvider newConnectionProvider)
Configurationderive in interface ConfigurationnewConnectionProvider - The new connection provider to be contained
in the derived configuration.public Configuration derive(java.util.concurrent.Executor newExecutor)
Configuration
This will wrap the argument Executor in a
DefaultExecutorProvider for convenience.
derive in interface ConfigurationnewExecutor - The new executor to be contained in the derived
configuration.public Configuration derive(ExecutorProvider newExecutorProvider)
Configurationderive in interface ConfigurationnewExecutorProvider - The new executor provider to be contained in
the derived configuration.public Configuration derive(TransactionProvider newTransactionProvider)
Configurationderive in interface ConfigurationnewTransactionProvider - The new transaction provider to be
contained in the derived configuration.public Configuration derive(RecordMapper<?,?> newRecordMapper)
Configuration
This will wrap the argument RecordMapper in a
DefaultRecordMapperProvider for convenience.
derive in interface ConfigurationnewRecordMapper - The new record mapper to be contained in the
derived configuration.public Configuration derive(RecordMapperProvider newRecordMapperProvider)
Configurationderive in interface ConfigurationnewRecordMapperProvider - The new record mapper provider to be
contained in the derived configuration.public Configuration derive(RecordUnmapper<?,?> newRecordUnmapper)
Configuration
This will wrap the argument RecordUnmapper in a
DefaultRecordUnmapperProvider for convenience.
derive in interface ConfigurationnewRecordUnmapper - The new record unmapper to be contained in the
derived configuration.public Configuration derive(RecordUnmapperProvider newRecordUnmapperProvider)
Configurationderive in interface ConfigurationnewRecordUnmapperProvider - The new record unmapper provider to be
contained in the derived configuration.public Configuration derive(RecordListener... newRecordListeners)
Configuration
This will wrap the argument RecordListener in a
DefaultRecordListenerProvider for convenience.
derive in interface ConfigurationnewRecordListeners - The new record listeners to be contained in the
derived configuration.public Configuration derive(RecordListenerProvider... newRecordListenerProviders)
Configurationderive in interface ConfigurationnewRecordListenerProviders - The new record listener providers to
be contained in the derived configuration.public Configuration derive(ExecuteListener... newExecuteListeners)
Configuration
This will wrap the argument ExecuteListener in a
DefaultExecuteListenerProvider for convenience.
derive in interface ConfigurationnewExecuteListeners - The new execute listener to be contained in
the derived configuration.public Configuration derive(ExecuteListenerProvider... newExecuteListenerProviders)
Configurationderive in interface ConfigurationnewExecuteListenerProviders - The new execute listener providers to
be contained in the derived configuration.public Configuration derive(VisitListener... newVisitListeners)
Configuration
This will wrap the argument VisitListener in a
DefaultVisitListenerProvider for convenience.
derive in interface ConfigurationnewVisitListeners - The new visit listeners to be contained in the
derived configuration.public Configuration derive(VisitListenerProvider... newVisitListenerProviders)
Configurationderive in interface ConfigurationnewVisitListenerProviders - The new visit listener providers to
be contained in the derived configuration.public Configuration derive(TransactionListener... newTransactionListeners)
Configuration
This will wrap the argument TransactionListener in a
DefaultTransactionListenerProvider for convenience.
derive in interface ConfigurationnewTransactionListeners - The new transaction listeners to be
contained in the derived configuration.public Configuration derive(TransactionListenerProvider... newTransactionListenerProviders)
Configurationderive in interface ConfigurationnewTransactionListenerProviders - The new transaction listener
providers to be contained in the derived configuration.public Configuration derive(ConverterProvider newConverterProvider)
Configurationderive in interface ConfigurationnewConverterProvider - The new converter provider to be contained in
the derived configuration.public Configuration derive(SQLDialect newDialect)
Configurationderive in interface ConfigurationnewDialect - The new dialect to be contained in the derived
configuration.public Configuration derive(Settings newSettings)
Configurationderive in interface ConfigurationnewSettings - The new settings to be contained in the derived
configuration.Copyright © 2018. All Rights Reserved.