Search in sources :

Example 1 with DynamicJdbcMapper

use of org.simpleflatmapper.jdbc.DynamicJdbcMapper in project SimpleFlatMapper by arnaudroger.

the class SfmResultSetHandlerFactoryBuilder method newFactory.

@Override
public <E> ResultSetHandlerFactory<E> newFactory(Class<E> aClass) {
    boolean exactMatch = !isAutoDeriveColumnNames();
    DefaultPropertyNameMatcherFactory propertyNameMatcherFactory = DefaultPropertyNameMatcherFactory.DEFAULT.exactMatch(exactMatch).caseSensitive(isCaseSensitive());
    Map<String, String> columnMappings = getColumnMappings();
    JdbcMapperFactory jdbcMapperFactory = JdbcMapperFactory.newInstance().propertyNameMatcherFactory(propertyNameMatcherFactory);
    if (columnMappings != null) {
        jdbcMapperFactory.addAliases(columnMappings);
    }
    DynamicJdbcMapper<E> dynamicJdbcMapper = (DynamicJdbcMapper<E>) jdbcMapperFactory.newMapper(aClass);
    return new SfmResultSetHandlerFactory<E>(dynamicJdbcMapper);
}
Also used : JdbcMapperFactory(org.simpleflatmapper.jdbc.JdbcMapperFactory) DynamicJdbcMapper(org.simpleflatmapper.jdbc.DynamicJdbcMapper) DefaultPropertyNameMatcherFactory(org.simpleflatmapper.map.mapper.DefaultPropertyNameMatcherFactory)

Aggregations

DynamicJdbcMapper (org.simpleflatmapper.jdbc.DynamicJdbcMapper)1 JdbcMapperFactory (org.simpleflatmapper.jdbc.JdbcMapperFactory)1 DefaultPropertyNameMatcherFactory (org.simpleflatmapper.map.mapper.DefaultPropertyNameMatcherFactory)1