Class JdbcMapperBuilder<T>

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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    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 Type
    Method
    Description
    addMapping(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.
    add the all the property present in the metaData
     

    Methods inherited from class org.simpleflatmapper.map.mapper.MapperBuilder

    addKey, addMapper, addMapping, addMapping, addMapping, addMapping, addMapping, addMapping, addMapping, addMapping, mapper, sourceFieldMapper

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public JdbcMapperBuilder(org.simpleflatmapper.util.TypeReference<T> target)
      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

      public JdbcMapperBuilder(Type target)
      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 type
      reflectService - 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

      public JdbcMapperBuilder<T> addMapping(String column, int index, int sqlType)
      add a new mapping to the specified property with the specified index and the specified type.
      Parameters:
      column - the property name
      index - the property index
      sqlType - 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 name
      index - the property index
      sqlType - the property type, @see java.sql.Types
      columnDefinition - the property definition
      Returns:
      the current builder
    • addMapping

      public JdbcMapperBuilder<T> addMapping(String column, int index, int sqlType, Object... properties)
      add a new mapping to the specified property with the specified index, the specified type.
      Parameters:
      column - the property name
      index - the property index
      sqlType - the property type, @see java.sql.Types
      properties - the property properties
      Returns:
      the current builder
    • addMapping

      public JdbcMapperBuilder<T> addMapping(ResultSetMetaData metaData) throws SQLException
      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

      public JdbcSourceFieldMapper<T> newSourceFieldMapper()