Package org.jdbi.v3.core.config
Interface Configurable<This>
- Type Parameters:
This
- The subtype that implements this interface.
- All Known Implementing Classes:
Batch
,Call
,Handle
,Jdbi
,MetaData
,PreparedBatch
,Query
,Script
,SqlStatement
,Update
public interface Configurable<This>
A type with access to access and modify arbitrary Jdbi configuration.
-
Method Summary
Modifier and TypeMethodDescriptiondefault This
addCustomizer
(StatementCustomizer customizer) default <C extends JdbiConfig<C>>
ThisPasses the configuration object of the given type to the configurer, then returns this object.default This
Convenience method forgetConfig(SqlStatements.class).define(key, value)
Returns the configuration registry associated with this object.default <C extends JdbiConfig<C>>
CGets the configuration object of the given type, associated with this object.default This
registerArgument
(ArgumentFactory factory) Convenience method forgetConfig(Arguments.class).register(factory)
default This
registerArgument
(QualifiedArgumentFactory factory) Convenience method forgetConfig(Arguments.class).register(factory)
default This
registerArrayType
(Class<?> elementType, String sqlTypeName) Convenience method forgetConfig(SqlArrayTypes.class).register(elementType, sqlTypeName)
default <T> This
registerArrayType
(Class<T> elementType, String sqlTypeName, Function<T, ?> conversion) Convenience method for registering an array type asSqlArrayTypeFactory.of(Class, String, Function)
.default This
registerArrayType
(SqlArrayType<?> arrayType) Convenience method forgetConfig(SqlArrayTypes.class).register(arrayType)
default This
registerArrayType
(SqlArrayTypeFactory factory) Convenience method forgetConfig(SqlArrayTypes.class).register(factory)
default This
registerCodecFactory
(CodecFactory codecFactory) Convenience method to register aCodecFactory
.default This
registerCollector
(Type collectionType, Collector<?, ?, ?> collector) Convenience method forgetConfig(JdbiCollectors.class).register(CollectorFactory.collectorFactory(collectionType, collector))
default This
registerCollector
(CollectorFactory factory) Convenience method forgetConfig(JdbiCollectors.class).register(factory)
default This
registerColumnMapper
(Type type, ColumnMapper<?> mapper) Convenience method forgetConfig(ColumnMappers.class).register(type, mapper)
default <T> This
registerColumnMapper
(GenericType<T> type, ColumnMapper<T> mapper) Convenience method forgetConfig(ColumnMappers.class).register(type, mapper)
default This
registerColumnMapper
(ColumnMapper<?> mapper) Convenience method forgetConfig(ColumnMappers.class).register(mapper)
default This
registerColumnMapper
(ColumnMapperFactory factory) Convenience method forgetConfig(ColumnMappers.class).register(factory)
default This
Convenience method forgetConfig(ColumnMappers.class).register(factory)
default <T> This
registerColumnMapper
(QualifiedType<T> type, ColumnMapper<T> mapper) Convenience method forgetConfig(ColumnMappers.class).register(type, mapper)
default This
registerExtension
(ExtensionFactory factory) Convenience method forgetConfig(Extensions.class).register(factory)
default This
registerRowMapper
(Type type, RowMapper<?> mapper) Convenience method forgetConfig(RowMappers.class).register(type, mapper)
default <T> This
registerRowMapper
(GenericType<T> type, RowMapper<T> mapper) Convenience method forgetConfig(RowMappers.class).register(type, mapper)
default This
registerRowMapper
(RowMapper<?> mapper) Convenience method forgetConfig(RowMappers.class).register(mapper)
default This
registerRowMapper
(RowMapperFactory factory) Convenience method forgetConfig(RowMappers.class).register(factory)
default This
setMapKeyColumn
(String keyColumn) Convenience method forgetConfig(MapEntryMappers.class).setKeyColumn(keyColumn)
default This
setMapValueColumn
(String valueColumn) Convenience method forgetConfig(MapEntryMappers.class).setValueColumn(valueColumn)
default This
Convenience method forgetConfig(SqlArrayTypes.class).setArgumentStrategy(strategy)
default This
setSqlLogger
(SqlLogger sqlLogger) default This
setSqlParser
(SqlParser parser) Convenience method forgetConfig(SqlStatements.class).setSqlParser(rewriter)
default This
setTemplateEngine
(TemplateEngine templateEngine) Convenience method forgetConfig(SqlStatements.class).setTemplateEngine(rewriter)
default This
setTimingCollector
(TimingCollector collector) Deprecated.
-
Method Details
-
getConfig
ConfigRegistry getConfig()Returns the configuration registry associated with this object.- Returns:
- the configuration registry associated with this object.
-
getConfig
Gets the configuration object of the given type, associated with this object.- Type Parameters:
C
- the configuration type- Parameters:
configClass
- the configuration type- Returns:
- the configuration object of the given type, associated with this object.
-
configure
Passes the configuration object of the given type to the configurer, then returns this object.- Type Parameters:
C
- the configuration type- Parameters:
configClass
- the configuration typeconfigurer
- consumer that will be passed the configuration object- Returns:
- this object (for call chaining)
-
setTemplateEngine
Convenience method forgetConfig(SqlStatements.class).setTemplateEngine(rewriter)
- Parameters:
templateEngine
- the template engine- Returns:
- this
-
setSqlParser
Convenience method forgetConfig(SqlStatements.class).setSqlParser(rewriter)
- Parameters:
parser
- SQL parser- Returns:
- this
-
setTimingCollector
Deprecated.Convenience method forgetConfig(SqlStatements.class).setTimingCollector(collector)
- Parameters:
collector
- timing collector- Returns:
- this
-
setSqlLogger
-
addCustomizer
-
define
Convenience method forgetConfig(SqlStatements.class).define(key, value)
- Parameters:
key
- attribute namevalue
- attribute value- Returns:
- this
-
registerArgument
Convenience method forgetConfig(Arguments.class).register(factory)
- Parameters:
factory
- argument factory- Returns:
- this
-
registerArgument
Convenience method forgetConfig(Arguments.class).register(factory)
- Parameters:
factory
- qualified argument factory- Returns:
- this
-
setSqlArrayArgumentStrategy
Convenience method forgetConfig(SqlArrayTypes.class).setArgumentStrategy(strategy)
- Parameters:
strategy
- argument strategy- Returns:
- this
-
setMapKeyColumn
Convenience method forgetConfig(MapEntryMappers.class).setKeyColumn(keyColumn)
- Parameters:
keyColumn
- the key column name- Returns:
- this
-
setMapValueColumn
Convenience method forgetConfig(MapEntryMappers.class).setValueColumn(valueColumn)
- Parameters:
valueColumn
- the value column name- Returns:
- this
-
registerArrayType
Convenience method forgetConfig(SqlArrayTypes.class).register(elementType, sqlTypeName)
- Parameters:
elementType
- element typesqlTypeName
- SQL type name- Returns:
- this
-
registerArrayType
default <T> This registerArrayType(Class<T> elementType, String sqlTypeName, Function<T, ?> conversion) Convenience method for registering an array type asSqlArrayTypeFactory.of(Class, String, Function)
.- Type Parameters:
T
- element type- Parameters:
elementType
- element raw typesqlTypeName
- SQL type nameconversion
- the function to convert to database representation- Returns:
- this
-
registerArrayType
Convenience method forgetConfig(SqlArrayTypes.class).register(arrayType)
- Parameters:
arrayType
- SQL array type- Returns:
- this
-
registerArrayType
Convenience method forgetConfig(SqlArrayTypes.class).register(factory)
- Parameters:
factory
- SQL array type factory- Returns:
- this
-
registerCollector
Convenience method forgetConfig(JdbiCollectors.class).register(CollectorFactory.collectorFactory(collectionType, collector))
- Parameters:
collectionType
- collector type to register the collector forcollector
- the Collector to use to build the resulting collection- Returns:
- this
- Since:
- 3.38.0
-
registerCollector
Convenience method forgetConfig(JdbiCollectors.class).register(factory)
- Parameters:
factory
- collector factory- Returns:
- this
-
registerColumnMapper
Convenience method forgetConfig(ColumnMappers.class).register(mapper)
- Parameters:
mapper
- column mapper- Returns:
- this
-
registerColumnMapper
Convenience method forgetConfig(ColumnMappers.class).register(type, mapper)
- Type Parameters:
T
- the type- Parameters:
type
- the generic type to registermapper
- the mapper to use on that type- Returns:
- this
-
registerColumnMapper
Convenience method forgetConfig(ColumnMappers.class).register(type, mapper)
- Parameters:
type
- the type to registermapper
- the mapper to use on that type- Returns:
- this
-
registerColumnMapper
Convenience method forgetConfig(ColumnMappers.class).register(type, mapper)
- Parameters:
type
- the type to registermapper
- the mapper to use on that type- Returns:
- this
-
registerColumnMapper
Convenience method forgetConfig(ColumnMappers.class).register(factory)
- Parameters:
factory
- column mapper factory- Returns:
- this
-
registerColumnMapper
Convenience method forgetConfig(ColumnMappers.class).register(factory)
- Parameters:
factory
- column mapper factory- Returns:
- this
-
registerExtension
Convenience method forgetConfig(Extensions.class).register(factory)
- Parameters:
factory
- extension factory- Returns:
- this
-
registerRowMapper
Convenience method forgetConfig(RowMappers.class).register(mapper)
- Parameters:
mapper
- row mapper- Returns:
- this
-
registerRowMapper
Convenience method forgetConfig(RowMappers.class).register(type, mapper)
- Type Parameters:
T
- the type- Parameters:
type
- to matchmapper
- row mapper- Returns:
- this
-
registerRowMapper
Convenience method forgetConfig(RowMappers.class).register(type, mapper)
- Parameters:
type
- to matchmapper
- row mapper- Returns:
- this
-
registerRowMapper
Convenience method forgetConfig(RowMappers.class).register(factory)
- Parameters:
factory
- row mapper factory- Returns:
- this
-
registerCodecFactory
Convenience method to register aCodecFactory
.- Parameters:
codecFactory
- codec factory- Returns:
- this
-
setSqlLogger(org.jdbi.v3.core.statement.SqlLogger)
instead