public class DefaultConfiguration extends java.lang.Object implements Configuration
DSLContext
, if no
custom configuration was supplied to DSL.using(Configuration)
.
The DefaultConfiguration
Constructor and Description |
---|
DefaultConfiguration()
Create a new "empty" configuration object.
|
Modifier and Type | Method and Description |
---|---|
ConnectionProvider |
connectionProvider()
Get this configuration's underlying connection provider.
|
java.util.concurrent.ConcurrentHashMap<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.sql.Connection newConnection)
Convenience method for
derive(ConnectionProvider) , using a
DefaultConnectionProvider . |
Configuration |
derive(ConnectionProvider newConnectionProvider)
Create a derived configuration from this one, with a new connection
provider.
|
Configuration |
derive(javax.sql.DataSource newDataSource)
Convenience method for
derive(ConnectionProvider) , using a
DataSourceConnectionProvider . |
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. |
SQLDialect |
family()
Retrieve the family of the configured dialect.
|
RecordListenerProvider[] |
recordListenerProviders()
Get the configured
RecordListenerProvider s from this
configuration. |
RecordMapperProvider |
recordMapperProvider()
Get this configuration's underlying record mapper provider.
|
SchemaMapping |
schemaMapping()
Deprecated.
|
Configuration |
set(java.sql.Connection newConnection)
Convenience method for
set(ConnectionProvider) , using a
DefaultConnectionProvider . |
Configuration |
set(ConnectionProvider newConnectionProvider)
Change this configuration to hold a new connection provider.
|
Configuration |
set(javax.sql.DataSource newDataSource)
Convenience method for
set(ConnectionProvider) , using a
DataSourceConnectionProvider . |
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.
|
void |
setConnection(java.sql.Connection newConnection) |
void |
setConnectionProvider(ConnectionProvider newConnectionProvider) |
void |
setDataSource(javax.sql.DataSource newDataSource) |
void |
setExecuteListenerProvider(ExecuteListenerProvider... newExecuteListenerProviders) |
void |
setRecordListenerProvider(RecordListenerProvider... newRecordListenerProviders) |
void |
setRecordMapperProvider(RecordMapperProvider newRecordMapperProvider) |
void |
setSettings(Settings newSettings) |
void |
setSQLDialect(SQLDialect newDialect) |
Settings |
settings()
Retrieve the runtime configuration settings.
|
void |
setTransactionProvider(TransactionProvider newTransactionProvider) |
void |
setVisitListenerProvider(VisitListenerProvider... newVisitListenerProviders) |
java.lang.String |
toString() |
TransactionProvider |
transactionProvider()
Get this configuration's underlying transaction provider.
|
VisitListenerProvider[] |
visitListenerProviders()
TODO [#2667]
|
public DefaultConfiguration()
This can be used as is, as a "dummy" configuration object, or as a base
implementation for creating more sophisticated "derived" configurations
through the various derive()
or set()
methods.
public final Configuration derive()
derive
in interface Configuration
public final Configuration derive(java.sql.Connection newConnection)
derive(ConnectionProvider)
, using a
DefaultConnectionProvider
.public final Configuration derive(javax.sql.DataSource newDataSource)
derive(ConnectionProvider)
, using a
DataSourceConnectionProvider
.public final Configuration derive(ConnectionProvider newConnectionProvider)
derive
in interface Configuration
newConnectionProvider
- The new connection provider to be contained
in the derived configuration.public final Configuration derive(TransactionProvider newTransactionProvider)
derive
in interface Configuration
newTransactionProvider
- The new transaction provider to be
contained in the derived configuration.public final Configuration derive(RecordMapperProvider newRecordMapperProvider)
derive
in interface Configuration
newRecordMapperProvider
- The new record mapper provider to be
contained in the derived configuration.public final Configuration derive(RecordListenerProvider... newRecordListenerProviders)
derive
in interface Configuration
newRecordListenerProviders
- The new record listener providers to
be contained in the derived configuration.public final Configuration derive(ExecuteListenerProvider... newExecuteListenerProviders)
derive
in interface Configuration
newExecuteListenerProviders
- The new execute listener providers to
be contained in the derived configuration.public final Configuration derive(VisitListenerProvider... newVisitListenerProviders)
derive
in interface Configuration
newVisitListenerProviders
- The new visit listener providers to
be contained in the derived configuration.public final Configuration derive(SQLDialect newDialect)
derive
in interface Configuration
newDialect
- The new dialect to be contained in the derived
configuration.public final Configuration derive(Settings newSettings)
derive
in interface Configuration
newSettings
- The new settings to be contained in the derived
configuration.public final Configuration set(java.sql.Connection newConnection)
set(ConnectionProvider)
, using a
DefaultConnectionProvider
.public final Configuration set(javax.sql.DataSource newDataSource)
set(ConnectionProvider)
, using a
DataSourceConnectionProvider
.public final Configuration set(ConnectionProvider newConnectionProvider)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
set
in interface Configuration
newConnectionProvider
- The new connection provider to be contained
in the changed configuration.public final Configuration set(TransactionProvider newTransactionProvider)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
set
in interface Configuration
newTransactionProvider
- The new transaction provider to be
contained in the changed configuration.public final Configuration set(RecordMapperProvider newRecordMapperProvider)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
set
in interface Configuration
newRecordMapperProvider
- The new record mapper provider to be
contained in the changed configuration.public final Configuration set(RecordListenerProvider... newRecordListenerProviders)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
set
in interface Configuration
newRecordListenerProviders
- The new record listener providers to
be contained in the changed configuration.public final Configuration set(ExecuteListenerProvider... newExecuteListenerProviders)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
set
in interface Configuration
newExecuteListenerProviders
- The new execute listener providers to
be contained in the changed configuration.public final Configuration set(VisitListenerProvider... newVisitListenerProviders)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
set
in interface Configuration
newVisitListenerProviders
- The new visit listener providers to
be contained in the changed configuration.public final Configuration set(SQLDialect newDialect)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
set
in interface Configuration
newDialect
- The new dialect to be contained in the changed
configuration.public final Configuration set(Settings newSettings)
This method is not thread-safe and should not be used in globally
available Configuration
objects.
set
in interface Configuration
newSettings
- The new settings to be contained in the changed
configuration.public final void setConnection(java.sql.Connection newConnection)
set(Connection)
public final void setDataSource(javax.sql.DataSource newDataSource)
set(DataSource)
public final void setConnectionProvider(ConnectionProvider newConnectionProvider)
set(ConnectionProvider)
public final void setTransactionProvider(TransactionProvider newTransactionProvider)
set(TransactionProvider)
public final void setRecordMapperProvider(RecordMapperProvider newRecordMapperProvider)
set(RecordMapperProvider)
public final void setRecordListenerProvider(RecordListenerProvider... newRecordListenerProviders)
set(RecordListenerProvider[])
public final void setExecuteListenerProvider(ExecuteListenerProvider... newExecuteListenerProviders)
set(ExecuteListenerProvider[])
public final void setVisitListenerProvider(VisitListenerProvider... newVisitListenerProviders)
set(VisitListenerProvider[])
public final void setSQLDialect(SQLDialect newDialect)
set(SQLDialect)
public final void setSettings(Settings newSettings)
set(Settings)
public final ConnectionProvider connectionProvider()
connectionProvider
in interface Configuration
public final TransactionProvider transactionProvider()
If no explicit transaction provider was specified, and if
Configuration.connectionProvider()
is a DefaultConnectionProvider
,
then this will return a DefaultTransactionProvider
.
transactionProvider
in interface Configuration
public final RecordMapperProvider recordMapperProvider()
recordMapperProvider
in interface Configuration
public final 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)recordListenerProviders
in interface Configuration
RecordListenerProvider
,
RecordListener
,
RecordContext
public final 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.
executeListenerProviders
in interface Configuration
ExecuteListenerProvider
,
ExecuteListener
,
ExecuteContext
public final VisitListenerProvider[] visitListenerProviders()
visitListenerProviders
in interface Configuration
public final SQLDialect dialect()
dialect
in interface Configuration
public final SQLDialect family()
family
in interface Configuration
public final Settings settings()
settings
in interface Configuration
public final java.util.concurrent.ConcurrentHashMap<java.lang.Object,java.lang.Object> data()
Configuration
.
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 Configuration
null
ExecuteListener
public final java.lang.Object data(java.lang.Object key)
Configuration
.
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 Configuration
key
- A key to identify the custom datanull
if no such data is contained
in this Configuration
ExecuteListener
public final java.lang.Object data(java.lang.Object key, java.lang.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.
data
in interface Configuration
key
- A key to identify the custom datavalue
- The custom datanull
if no data
was previously set for the given keyExecuteListener
@Deprecated public final SchemaMapping schemaMapping()
schemaMapping
in interface Configuration
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014. All Rights Reserved.