org.springframework.batch.item.database.JdbcCursorItemReader Java Examples

The following examples show how to use org.springframework.batch.item.database.JdbcCursorItemReader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AddressMigrationJobConfiguration.java    From spring-batch-lightmin with Apache License 2.0 5 votes vote down vote up
@Bean
public JdbcCursorItemReader<BatchTaskAddress> addressReader(final DataSource dataSource,
                                                            final BatchTaskAddressMapper batchTaskAddressMapper) throws Exception {
    final JdbcCursorItemReader<BatchTaskAddress> reader = new JdbcCursorItemReader<>();
    reader.setSql(SELECT_ADDRESS_QUERY);
    reader.setRowMapper(batchTaskAddressMapper);
    reader.setDataSource(dataSource);
    reader.setMaxRows(100);
    reader.afterPropertiesSet();
    return reader;
}
 
Example #2
Source File: AddressPrinterJobConfiguration.java    From spring-batch-lightmin with Apache License 2.0 4 votes vote down vote up
@Bean
public JdbcCursorItemReader<Long> addressPrinterReader(final DataSource dataSource) throws Exception {
    final JdbcCursorItemReader<Long> reader = new JdbcCursorItemReader<>();
    reader.setSql(SELECT_ADDRESS_QUERY);
    reader.setRowMapper(new SingleColumnRowMapper<>());
    reader.setDataSource(dataSource);
    reader.setMaxRows(100);
    reader.afterPropertiesSet();
    return reader;
}
 
Example #3
Source File: AddressPrinterJobConfiguration.java    From spring-batch-lightmin with Apache License 2.0 4 votes vote down vote up
@Bean
public JdbcCursorItemReader<Long> addressBatchTaskDeletionReader(final DataSource dataSource) throws Exception {
    final JdbcCursorItemReader<Long> reader = new JdbcCursorItemReader<>();
    reader.setSql(SELECT_BATCH_TASK_ADDRESS_TO_DELETE_QUERY);
    reader.setRowMapper(new SingleColumnRowMapper<>());
    reader.setDataSource(dataSource);
    reader.setMaxRows(50);
    reader.afterPropertiesSet();
    return reader;
}