public interface Configuration extends Serializable
Configuration
configures a DSLContext
, providing it
with information for query construction, rendering and execution.
A Configuration
wraps all information elements that are
needed...
DSLContext
to construct Query
objectsRenderContext
to render Query
objects and
QueryPart
sBindContext
to bind values to Query
objects and
QueryPart
sQuery
or Routine
object to execute itself
The simplest usage of a Configuration
instance is to use it
exactly for a single Query
execution, disposing it immediately.
This will make it very simple to implement thread-safe behaviour.
At the same time, jOOQ does not require Configuration
instances
to be that short-lived. Thread-safety will then be delegated to component
objects, such as the ConnectionProvider
, the ExecuteListener
list, etc.
Modifier and Type | Method and Description |
---|---|
ConnectionProvider |
connectionProvider()
Get this configuration's underlying connection provider.
|
Map<Object,Object> |
data()
Get all custom data from this
Configuration . |
Object |
data(Object key)
Get some custom data from this
Configuration . |
Object |
data(Object key,
Object value)
Set some custom data to this
Configuration . |
Configuration |
derive()
Create a derived configuration from this one, without changing any
properties.
|
Configuration |
derive(ConnectionProvider newConnectionProvider)
Create a derived configuration from this one, with a new connection
provider.
|
Configuration |
derive(ExecuteListenerProvider... newExecuteListenerProviders)
Create a derived configuration from this one, with new execute listener
providers.
|
Configuration |
derive(RecordListenerProvider... newRecordListenerProviders)
Create a derived configuration from this one, with new record listener
providers.
|
Configuration |
derive(RecordMapperProvider newRecordMapperProvider)
Create a derived configuration from this one, with a new record mapper
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(TransactionProvider newTransactionProvider)
Create a derived configuration from this one, with a new transaction
provider.
|
Configuration |
derive(VisitListenerProvider... newVisitListenerProviders)
Create a derived configuration from this one, with new visit listener
providers.
|
SQLDialect |
dialect()
Retrieve the configured dialect.
|
ExecuteListenerProvider[] |
executeListenerProviders()
Get the configured
ExecuteListenerProvider s from this
configuration. |
RecordListenerProvider[] |
recordListenerProviders()
Get the configured
RecordListenerProvider s from this
configuration. |
RecordMapperProvider |
recordMapperProvider()
Get this configuration's underlying record mapper provider.
|
SchemaMapping |
schemaMapping()
Deprecated.
- 2.0.5 - Use
settings() instead |
Configuration |
set(ConnectionProvider newConnectionProvider)
Change this configuration to hold a new connection provider.
|
Configuration |
set(ExecuteListenerProvider... newExecuteListenerProviders)
Change this configuration to hold a new execute listener providers.
|
Configuration |
set(RecordListenerProvider... newRecordListenerProviders)
Change this configuration to hold a new record listener providers.
|
Configuration |
set(RecordMapperProvider newRecordMapperProvider)
Change this configuration to hold a new record mapper 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(TransactionProvider newTransactionProvider)
Change this configuration to hold a new transaction provider.
|
Configuration |
set(VisitListenerProvider... newVisitListenerProviders)
Change this configuration to hold a new visit listener providers.
|
Settings |
settings()
Retrieve the runtime configuration settings.
|
TransactionProvider |
transactionProvider()
Get this configuration's underlying transaction provider.
|
VisitListenerProvider[] |
visitListenerProviders()
TODO [#2667]
|
Map<Object,Object> data()
Configuration
.
This is custom data that was previously set to the configuration using
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.
null
ExecuteListener
Object data(Object key)
Configuration
.
This is custom data that was previously set to the configuration using
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.
key
- A key to identify the custom datanull
if no such data is contained
in this Configuration
ExecuteListener
Object data(Object key, Object value)
Configuration
.
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.
key
- A key to identify the custom datavalue
- The custom datanull
if no data
was previously set for the given keyExecuteListener
ConnectionProvider connectionProvider()
TransactionProvider transactionProvider()
If no explicit transaction provider was specified, and if
connectionProvider()
is a DefaultConnectionProvider
,
then this will return a DefaultTransactionProvider
.
RecordMapperProvider recordMapperProvider()
RecordListenerProvider[] recordListenerProviders()
RecordListenerProvider
s 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)RecordListenerProvider
,
RecordListener
,
RecordContext
ExecuteListenerProvider[] executeListenerProviders()
ExecuteListenerProvider
s 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.
ExecuteListenerProvider
,
ExecuteListener
,
ExecuteContext
VisitListenerProvider[] visitListenerProviders()
@Deprecated SchemaMapping schemaMapping()
settings()
insteadSQLDialect dialect()
Settings settings()
Configuration set(ConnectionProvider newConnectionProvider)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
newConnectionProvider
- The new connection provider to be contained
in the changed configuration.Configuration set(TransactionProvider newTransactionProvider)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
newTransactionProvider
- The new transaction provider to be
contained in the changed configuration.Configuration set(RecordMapperProvider newRecordMapperProvider)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
newRecordMapperProvider
- The new record mapper provider to be
contained in the changed configuration.Configuration set(RecordListenerProvider... newRecordListenerProviders)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
newRecordListenerProviders
- The new record listener providers to
be contained in the changed configuration.Configuration set(ExecuteListenerProvider... newExecuteListenerProviders)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
newExecuteListenerProviders
- The new execute listener providers to
be contained in the changed configuration.Configuration set(VisitListenerProvider... newVisitListenerProviders)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
newVisitListenerProviders
- The new visit listener providers to
be contained in the changed configuration.Configuration set(SQLDialect newDialect)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
newDialect
- The new dialect to be contained in the changed
configuration.Configuration set(Settings newSettings)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
newSettings
- The new settings to be contained in the changed
configuration.Configuration derive()
Configuration derive(ConnectionProvider newConnectionProvider)
newConnectionProvider
- The new connection provider to be contained
in the derived configuration.Configuration derive(TransactionProvider newTransactionProvider)
newTransactionProvider
- The new transaction provider to be
contained in the derived configuration.Configuration derive(RecordMapperProvider newRecordMapperProvider)
newRecordMapperProvider
- The new record mapper provider to be
contained in the derived configuration.Configuration derive(RecordListenerProvider... newRecordListenerProviders)
newRecordListenerProviders
- The new record listener providers to
be contained in the derived configuration.Configuration derive(ExecuteListenerProvider... newExecuteListenerProviders)
newExecuteListenerProviders
- The new execute listener providers to
be contained in the derived configuration.Configuration derive(VisitListenerProvider... newVisitListenerProviders)
newVisitListenerProviders
- The new visit listener providers to
be contained in the derived configuration.Configuration derive(SQLDialect newDialect)
newDialect
- The new dialect to be contained in the derived
configuration.Configuration derive(Settings newSettings)
newSettings
- The new settings to be contained in the derived
configuration.Copyright © 2015. All Rights Reserved.