java.lang.Object
org.simpleflatmapper.map.mapper.MapperBuilder<ResultSet,ResultSet,T,JdbcColumnKey,SQLException,org.simpleflatmapper.map.SetRowMapper<ResultSet,ResultSet,T,SQLException>,JdbcMapper<T>,JdbcMapperBuilder<T>>
org.simpleflatmapper.jdbc.JdbcMapperBuilder<T>
- Type Parameters:
T- the targeted type of the jdbcMapper
public final class JdbcMapperBuilder<T>
extends org.simpleflatmapper.map.mapper.MapperBuilder<ResultSet,ResultSet,T,JdbcColumnKey,SQLException,org.simpleflatmapper.map.SetRowMapper<ResultSet,ResultSet,T,SQLException>,JdbcMapper<T>,JdbcMapperBuilder<T>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.simpleflatmapper.util.Function<Object[],org.simpleflatmapper.map.mapper.ColumnDefinition<JdbcColumnKey, ?>> Fields inherited from class org.simpleflatmapper.map.mapper.MapperBuilder
columnDefinitionFactory, keyFactory, setRowMapperBuilder, specialisedMapper -
Constructor Summary
ConstructorsConstructorDescriptionJdbcMapperBuilder(Type target) Build a new JdbcMapperBuilder targeting the specified type.JdbcMapperBuilder(Type target, org.simpleflatmapper.reflect.ReflectionService reflectService) Build a new JdbcMapperBuilder targeting the specified type with the specified ReflectionService.JdbcMapperBuilder(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta, org.simpleflatmapper.map.MapperConfig<JdbcColumnKey, ResultSet> mapperConfig, org.simpleflatmapper.map.getter.ContextualGetterFactory<? super ResultSet, JdbcColumnKey> getterFactory, org.simpleflatmapper.map.context.MappingContextFactoryBuilder<ResultSet, JdbcColumnKey> parentBuilder) JdbcMapperBuilder(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta, org.simpleflatmapper.map.MapperConfig<JdbcColumnKey, ResultSet> mapperConfig, org.simpleflatmapper.reflect.getter.GetterFactory<ResultSet, JdbcColumnKey> getterFactory, org.simpleflatmapper.map.context.MappingContextFactoryBuilder<ResultSet, JdbcColumnKey> parentBuilder) JdbcMapperBuilder(org.simpleflatmapper.util.TypeReference<T> target) Build a new JdbcMapperBuilder targeting the type specified by the TypeReference. -
Method Summary
Modifier and TypeMethodDescriptionaddMapping(String column, int index, int sqlType) add a new mapping to the specified property with the specified index and the specified type.addMapping(String column, int index, int sqlType, Object... properties) add a new mapping to the specified property with the specified index, the specified type.addMapping(String column, int index, int sqlType, org.simpleflatmapper.map.property.FieldMapperColumnDefinition<JdbcColumnKey> columnDefinition) add a new mapping to the specified property with the specified index, the specified type.addMapping(ResultSetMetaData metaData) add the all the property present in the metaDataMethods inherited from class org.simpleflatmapper.map.mapper.MapperBuilder
addKey, addMapper, addMapping, addMapping, addMapping, addMapping, addMapping, addMapping, addMapping, addMapping, mapper, sourceFieldMapper
-
Field Details
-
COLUMN_DEFINITION_FACTORY
public static final org.simpleflatmapper.util.Function<Object[],org.simpleflatmapper.map.mapper.ColumnDefinition<JdbcColumnKey, COLUMN_DEFINITION_FACTORY?>>
-
-
Constructor Details
-
JdbcMapperBuilder
Build a new JdbcMapperBuilder targeting the type specified by the TypeReference. The TypeReference allow you to provide a generic type with check of T
new TypeReference<List<String>>() {}- Parameters:
target- the TypeReference to the type T to map to
-
JdbcMapperBuilder
Build a new JdbcMapperBuilder targeting the specified type.- Parameters:
target- the type
-
JdbcMapperBuilder
public JdbcMapperBuilder(Type target, org.simpleflatmapper.reflect.ReflectionService reflectService) Build a new JdbcMapperBuilder targeting the specified type with the specified ReflectionService.- Parameters:
target- the typereflectService- the ReflectionService
-
JdbcMapperBuilder
public JdbcMapperBuilder(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta, org.simpleflatmapper.map.MapperConfig<JdbcColumnKey, ResultSet> mapperConfig, org.simpleflatmapper.reflect.getter.GetterFactory<ResultSet, JdbcColumnKey> getterFactory, org.simpleflatmapper.map.context.MappingContextFactoryBuilder<ResultSet, JdbcColumnKey> parentBuilder) - Parameters:
classMeta- the meta for the target class.mapperConfig- the mapperConfig.getterFactory- the Getter factory.parentBuilder- the parent builder, null if none.
-
JdbcMapperBuilder
public JdbcMapperBuilder(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta, org.simpleflatmapper.map.MapperConfig<JdbcColumnKey, ResultSet> mapperConfig, org.simpleflatmapper.map.getter.ContextualGetterFactory<? super ResultSet, JdbcColumnKey> getterFactory, org.simpleflatmapper.map.context.MappingContextFactoryBuilder<ResultSet, JdbcColumnKey> parentBuilder) - Parameters:
classMeta- the meta for the target class.mapperConfig- the mapperConfig.getterFactory- the Getter factory.parentBuilder- the parent builder, null if none.
-
-
Method Details
-
addMapping
add a new mapping to the specified property with the specified index and the specified type.- Parameters:
column- the property nameindex- the property indexsqlType- the property type, @see java.sql.Types- Returns:
- the current builder
-
addMapping
public JdbcMapperBuilder<T> addMapping(String column, int index, int sqlType, org.simpleflatmapper.map.property.FieldMapperColumnDefinition<JdbcColumnKey> columnDefinition) add a new mapping to the specified property with the specified index, the specified type.- Parameters:
column- the property nameindex- the property indexsqlType- the property type, @see java.sql.TypescolumnDefinition- the property definition- Returns:
- the current builder
-
addMapping
add a new mapping to the specified property with the specified index, the specified type.- Parameters:
column- the property nameindex- the property indexsqlType- the property type, @see java.sql.Typesproperties- the property properties- Returns:
- the current builder
-
addMapping
add the all the property present in the metaData- Parameters:
metaData- the metaDAta- Returns:
- the current builder
- Throws:
SQLException- when an error occurs getting the metaData
-
newSourceFieldMapper
-