org.sfm.jdbc
T - the targeted type of the mapperpublic final class JdbcMapperBuilder<T> extends AbstractFieldMapperMapperBuilder<ResultSet,T,JdbcColumnKey>
columnDefinitions, mapperBuilderErrorHandler, mappingContextFactoryBuilder, propertyNameMatcherFactory, reflectionService| Constructor and Description |
|---|
JdbcMapperBuilder(ClassMeta<T> classMeta,
MapperBuilderErrorHandler mapperBuilderErrorHandler,
ColumnDefinitionProvider<FieldMapperColumnDefinition<JdbcColumnKey,ResultSet>,JdbcColumnKey> columnDefinitions,
PropertyNameMatcherFactory propertyNameMatcherFactory,
GetterFactory<ResultSet,JdbcColumnKey> getterFactory,
boolean failOnAsm,
MappingContextFactoryBuilder<ResultSet,JdbcColumnKey> parentBuilder) |
JdbcMapperBuilder(Type target)
Build a new JdbcMapperBuilder targeting the specified type.
|
JdbcMapperBuilder(TypeReference<T> target)
Build a new JdbcMapperBuilder targeting the type specified by the TypeReference.
|
JdbcMapperBuilder(Type target,
ReflectionService reflectService)
Build a new JdbcMapperBuilder targeting the specified type with the specified ReflectionService.
|
| Modifier and Type | Method and Description |
|---|---|
JdbcMapperBuilder<T> |
addKey(String column)
add a new mapping to the specified column with a key column definition and an undefined type.
|
JdbcMapperBuilder<T> |
addMapper(FieldMapper<ResultSet,T> mapper)
append a FieldMapper to the mapping list.
|
JdbcMapperBuilder<T> |
addMapping(ResultSetMetaData metaData)
add the all the column present in the metaData
|
JdbcMapperBuilder<T> |
addMapping(String column)
add a new mapping to the specified column with an undefined type.
|
JdbcMapperBuilder<T> |
addMapping(String column,
FieldMapperColumnDefinition<JdbcColumnKey,ResultSet> columnDefinition)
add a new mapping to the specified column with the specified columnDefinition and an undefined type.
|
JdbcMapperBuilder<T> |
addMapping(String column,
int index)
add a new mapping to the specified column with the specified index and an undefined type.
|
JdbcMapperBuilder<T> |
addMapping(String column,
int index,
FieldMapperColumnDefinition<JdbcColumnKey,ResultSet> columnDefinition)
add a new mapping to the specified column with the specified index, specified column definition and an undefined type.
|
JdbcMapperBuilder<T> |
addMapping(String column,
int index,
int sqlType)
add a new mapping to the specified column with the specified index and the specified type.
|
JdbcMapperBuilder<T> |
addMapping(String column,
int index,
int sqlType,
FieldMapperColumnDefinition<JdbcColumnKey,ResultSet> columnDefinition)
add a new mapping to the specified column with the specified index, the specified type.
|
JdbcMapperBuilder<T> |
fieldMapperErrorHandler(FieldMapperErrorHandler<JdbcColumnKey> errorHandler)
the FieldMapperErrorHandler is called when a error occurred when mapping a field from the source to the target.
|
JdbcMapperBuilder<T> |
jdbcMapperErrorHandler(RowHandlerErrorHandler jdbcMapperErrorHandler)
the RowHandlerErrorHandler is called when an exception is thrown by the RowHandler in the forEach call.
|
JdbcMapper<T> |
mapper() |
protected <ST> AbstractFieldMapperMapperBuilder<ResultSet,ST,JdbcColumnKey> |
newSubBuilder(Type type,
ClassMeta<ST> classMeta,
MappingContextFactoryBuilder<ResultSet,JdbcColumnKey> mappingContextFactoryBuilder) |
_addMapper, _addMapping, addMapping, fields, getConstructorFieldMappersAndInstantiator, getTargetClass, newFieldMapper, setFieldMapperErrorHandlerpublic JdbcMapperBuilder(TypeReference<T> target)
new TypeReference<List<String>>() {}target - the TypeReference to the type T to map topublic JdbcMapperBuilder(Type target)
target - the typepublic JdbcMapperBuilder(Type target, ReflectionService reflectService)
target - the typereflectService - the ReflectionServicepublic JdbcMapperBuilder(ClassMeta<T> classMeta, MapperBuilderErrorHandler mapperBuilderErrorHandler, ColumnDefinitionProvider<FieldMapperColumnDefinition<JdbcColumnKey,ResultSet>,JdbcColumnKey> columnDefinitions, PropertyNameMatcherFactory propertyNameMatcherFactory, GetterFactory<ResultSet,JdbcColumnKey> getterFactory, boolean failOnAsm, MappingContextFactoryBuilder<ResultSet,JdbcColumnKey> parentBuilder)
classMeta - the meta for the target class.mapperBuilderErrorHandler - the error handler.columnDefinitions - the predefined ColumnDefninition.propertyNameMatcherFactory - the PropertyNameMatcher factory.getterFactory - the Getter factory.failOnAsm - should we fail on asm generation.parentBuilder - the parent builder, null if none.public JdbcMapper<T> mapper()
mapper in class AbstractFieldMapperMapperBuilder<ResultSet,T,JdbcColumnKey>public JdbcMapperBuilder<T> addKey(String column)
column - the column namepublic JdbcMapperBuilder<T> addMapping(String column)
column - the column namepublic JdbcMapperBuilder<T> addMapping(String column, FieldMapperColumnDefinition<JdbcColumnKey,ResultSet> columnDefinition)
column - the column namecolumnDefinition - the definitionpublic JdbcMapperBuilder<T> addMapping(String column, int index)
column - the column nameindex - the column indexpublic JdbcMapperBuilder<T> addMapping(String column, int index, FieldMapperColumnDefinition<JdbcColumnKey,ResultSet> columnDefinition)
column - the column nameindex - the column indexcolumnDefinition - the column definitionpublic JdbcMapperBuilder<T> addMapper(FieldMapper<ResultSet,T> mapper)
mapper - the field mapperpublic JdbcMapperBuilder<T> addMapping(String column, int index, int sqlType)
column - the column nameindex - the column indexsqlType - the column type, @see java.sql.Typespublic JdbcMapperBuilder<T> addMapping(String column, int index, int sqlType, FieldMapperColumnDefinition<JdbcColumnKey,ResultSet> columnDefinition)
column - the column nameindex - the column indexsqlType - the column type, @see java.sql.TypescolumnDefinition - the column definitionpublic JdbcMapperBuilder<T> addMapping(ResultSetMetaData metaData) throws SQLException
metaData - the metaDAtaSQLExceptionprotected <ST> AbstractFieldMapperMapperBuilder<ResultSet,ST,JdbcColumnKey> newSubBuilder(Type type, ClassMeta<ST> classMeta, MappingContextFactoryBuilder<ResultSet,JdbcColumnKey> mappingContextFactoryBuilder)
newSubBuilder in class AbstractFieldMapperMapperBuilder<ResultSet,T,JdbcColumnKey>public JdbcMapperBuilder<T> fieldMapperErrorHandler(FieldMapperErrorHandler<JdbcColumnKey> errorHandler)
errorHandler - the new FieldMapperErrorHandlerpublic JdbcMapperBuilder<T> jdbcMapperErrorHandler(RowHandlerErrorHandler jdbcMapperErrorHandler)
jdbcMapperErrorHandler - the new RowHandlerErrorHandlerCopyright © 2015. All rights reserved.