List of usage examples for org.springframework.jdbc.core SingleColumnRowMapper newInstance
public static <T> SingleColumnRowMapper<T> newInstance(Class<T> requiredType)
From source file:nu.yona.server.batch.jobs.ActivityAggregationBatchJob.java
private JdbcPagingItemReader<Long> createReader(Date cutOffDate, int chunkSize, SqlPagingQueryProviderFactoryBean sqlPagingQueryProviderFactoryBean) { try {/* ww w . jav a 2 s. c o m*/ JdbcPagingItemReader<Long> reader = new JdbcPagingItemReader<>(); reader.setQueryProvider(sqlPagingQueryProviderFactoryBean.getObject()); reader.setDataSource(dataSource); reader.setPageSize(chunkSize); reader.setRowMapper(SingleColumnRowMapper.newInstance(Long.class)); reader.setParameterValues(Collections.singletonMap("cutOffDate", cutOffDate)); reader.afterPropertiesSet(); reader.setSaveState(true); return reader; } catch (Exception e) { throw YonaException.unexpected(e); } }