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);
}
Aggregations