use of cz.mzk.recordmanager.server.jdbc.Cosmotron996RowMapper in project RecordManager2 by moravianlibrary.
the class ExportRecordsJobConfig method exportCosmotron996Reader.
@Bean(name = Constants.JOB_ID_EXPORT_COSMOTRON_996 + ":exportCosmotron996Reader")
@StepScope
public ItemReader<Cosmotron996> exportCosmotron996Reader(@Value("#{jobParameters[" + Constants.JOB_PARAM_CONF_ID + "]}") Long configId) throws Exception {
JdbcPagingItemReader<Cosmotron996> reader = new JdbcPagingItemReader<Cosmotron996>();
SqlPagingQueryProviderFactoryBean pqpf = new SqlPagingQueryProviderFactoryBean();
pqpf.setDataSource(dataSource);
pqpf.setSelectClause("SELECT *");
pqpf.setFromClause("FROM cosmotron_996");
pqpf.setWhereClause("WHERE import_conf_id = :conf_id");
pqpf.setSortKey("record_id");
Map<String, Object> parameterValues = new HashMap<String, Object>();
parameterValues.put("conf_id", configId);
reader.setParameterValues(parameterValues);
reader.setRowMapper(new Cosmotron996RowMapper());
reader.setPageSize(20);
reader.setQueryProvider(pqpf.getObject());
reader.setDataSource(dataSource);
reader.afterPropertiesSet();
return reader;
}
Aggregations