public class ColumnMappers extends Object implements JdbiConfig<ColumnMappers>
ColumnMapperFactory instances.| Constructor and Description |
|---|
ColumnMappers() |
| Modifier and Type | Method and Description |
|---|---|
ColumnMappers |
createCopy()
Returns a copy of this configuration object.
|
<T> Optional<ColumnMapper<T>> |
findFor(Class<T> type)
Obtain a column mapper for the given type.
|
<T> Optional<ColumnMapper<T>> |
findFor(GenericType<T> type)
Obtain a column mapper for the given type.
|
<T> Optional<ColumnMapper<T>> |
findFor(QualifiedType<T> type)
Obtain a column mapper for the given qualified type.
|
Optional<ColumnMapper<?>> |
findFor(Type type)
Obtain a column mapper for the given type.
|
boolean |
getCoalesceNullPrimitivesToDefaults() |
ColumnMappers |
register(ColumnMapper<?> mapper)
Register a column mapper which will have its parameterized type inspected to determine what it maps to.
|
ColumnMappers |
register(ColumnMapperFactory factory)
Register a column mapper factory.
|
<T> ColumnMappers |
register(GenericType<T> type,
ColumnMapper<T> mapper)
Register a column mapper for a given explicit
GenericType
Column mappers may be reused by RowMapper to map individual columns. |
<T> ColumnMappers |
register(QualifiedType<T> type,
ColumnMapper<T> mapper)
Register a column mapper for a given
QualifiedType
Column mappers may be reused by RowMapper to map individual columns. |
ColumnMappers |
register(Type type,
ColumnMapper<?> mapper)
|
void |
setCoalesceNullPrimitivesToDefaults(boolean coalesceNullPrimitivesToDefaults) |
void |
setRegistry(ConfigRegistry registry)
The registry will inject itself into the configuration object.
|
public ColumnMappers createCopy()
JdbiConfigcreateCopy in interface JdbiConfig<ColumnMappers>public <T> Optional<ColumnMapper<T>> findFor(Class<T> type)
T - the type to maptype - the target type to map topublic <T> Optional<ColumnMapper<T>> findFor(GenericType<T> type)
T - the type to maptype - the target type to map to@Beta public <T> Optional<ColumnMapper<T>> findFor(QualifiedType<T> type)
type - the qualified target type to map topublic Optional<ColumnMapper<?>> findFor(Type type)
type - the target type to map topublic boolean getCoalesceNullPrimitivesToDefaults()
true if database nulls should translate to the Java defaults for primitives, or throw an exception otherwise
Default value is true: nulls will be coalesced to defaultspublic ColumnMappers register(ColumnMapper<?> mapper)
RowMapper to map individual columns.
The parameter must be concretely parameterized, we use the type argument T to determine if it applies to a given type.
mapper - the column mapperUnsupportedOperationException - if the ColumnMapper is not a concretely parameterized typepublic ColumnMappers register(ColumnMapperFactory factory)
Column mappers may be reused by RowMapper to map individual columns.
factory - the column mapper factorypublic <T> ColumnMappers register(GenericType<T> type, ColumnMapper<T> mapper)
GenericType
Column mappers may be reused by RowMapper to map individual columns.T - the typetype - the generic type to match with equals.mapper - the column mapper@Beta public <T> ColumnMappers register(QualifiedType<T> type, ColumnMapper<T> mapper)
QualifiedType
Column mappers may be reused by RowMapper to map individual columns.type - the type to match with equals.mapper - the column mapperpublic ColumnMappers register(Type type, ColumnMapper<?> mapper)
Type
Column mappers may be reused by RowMapper to map individual columns.type - the type to match with equals.mapper - the column mapperpublic void setCoalesceNullPrimitivesToDefaults(boolean coalesceNullPrimitivesToDefaults)
public void setRegistry(ConfigRegistry registry)
JdbiConfigsetRegistry in interface JdbiConfig<ColumnMappers>registry - the registry that owns this configuration objectCopyright © 2019. All rights reserved.