public class JdbcCursorItemReaderBuilder<T>
extends java.lang.Object
JdbcCursorItemReader
Constructor and Description |
---|
JdbcCursorItemReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
JdbcCursorItemReaderBuilder<T> |
beanRowMapper(java.lang.Class<T> mappedClass)
Creates a
BeanPropertyRowMapper to be used as your
RowMapper . |
JdbcCursorItemReader<T> |
build()
Validates configuration and builds a new reader instance.
|
JdbcCursorItemReaderBuilder<T> |
currentItemCount(int currentItemCount)
Index for the current item.
|
JdbcCursorItemReaderBuilder<T> |
dataSource(javax.sql.DataSource dataSource)
The
DataSource to read from |
JdbcCursorItemReaderBuilder<T> |
driverSupportsAbsolute(boolean driverSupportsAbsolute)
Indicates if the JDBC driver supports setting the absolute row on the
ResultSet . |
JdbcCursorItemReaderBuilder<T> |
fetchSize(int fetchSize)
A hint to the driver as to how many rows to return with each fetch.
|
JdbcCursorItemReaderBuilder<T> |
ignoreWarnings(boolean ignoreWarnings) |
JdbcCursorItemReaderBuilder<T> |
maxItemCount(int maxItemCount)
Configure the max number of items to be read.
|
JdbcCursorItemReaderBuilder<T> |
maxRows(int maxRows)
The max number of rows the
ResultSet can contain |
JdbcCursorItemReaderBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
JdbcCursorItemReaderBuilder<T> |
preparedStatementSetter(org.springframework.jdbc.core.PreparedStatementSetter preparedStatementSetter)
Configures the provided
PreparedStatementSetter to be used to populate any
arguments in the SQL query to be executed for the reader. |
JdbcCursorItemReaderBuilder<T> |
queryArguments(java.util.List<?> args)
Configures a
PreparedStatementSetter that will use the List as the values
to be set on the query to be executed for this reader. |
JdbcCursorItemReaderBuilder<T> |
queryArguments(java.lang.Object[] args)
Configures a
PreparedStatementSetter that will use the array as the values
to be set on the query to be executed for this reader. |
JdbcCursorItemReaderBuilder<T> |
queryArguments(java.lang.Object[] args,
int[] types)
Configures a
PreparedStatementSetter that will use the Object [] as the
values to be set on the query to be executed for this reader. |
JdbcCursorItemReaderBuilder<T> |
queryTimeout(int queryTimeout)
The time in milliseconds for the query to timeout
|
JdbcCursorItemReaderBuilder<T> |
rowMapper(org.springframework.jdbc.core.RowMapper<T> rowMapper)
The
RowMapper used to map the results of the cursor to each item. |
JdbcCursorItemReaderBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
JdbcCursorItemReaderBuilder<T> |
sql(java.lang.String sql)
The query to be executed for this reader
|
JdbcCursorItemReaderBuilder<T> |
useSharedExtendedConnection(boolean useSharedExtendedConnection)
Indicates that the connection used for the cursor is being used by all other
processing, therefor part of the same transaction.
|
JdbcCursorItemReaderBuilder<T> |
verifyCursorPosition(boolean verifyCursorPosition)
Indicates if the reader should verify the current position of the
ResultSet after being passed to the RowMapper . |
public JdbcCursorItemReaderBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic JdbcCursorItemReaderBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public JdbcCursorItemReaderBuilder<T> maxItemCount(int maxItemCount)
maxItemCount
- the max items to be readAbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
public JdbcCursorItemReaderBuilder<T> currentItemCount(int currentItemCount)
currentItemCount
- current indexAbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
public JdbcCursorItemReaderBuilder<T> dataSource(javax.sql.DataSource dataSource)
DataSource
to read fromdataSource
- a relational data baseAbstractCursorItemReader.setDataSource(DataSource)
public JdbcCursorItemReaderBuilder<T> fetchSize(int fetchSize)
fetchSize
- the hintAbstractCursorItemReader.setFetchSize(int)
public JdbcCursorItemReaderBuilder<T> maxRows(int maxRows)
ResultSet
can containmaxRows
- the maxAbstractCursorItemReader.setMaxRows(int)
public JdbcCursorItemReaderBuilder<T> queryTimeout(int queryTimeout)
queryTimeout
- timeoutAbstractCursorItemReader.setQueryTimeout(int)
public JdbcCursorItemReaderBuilder<T> ignoreWarnings(boolean ignoreWarnings)
public JdbcCursorItemReaderBuilder<T> verifyCursorPosition(boolean verifyCursorPosition)
ResultSet
after being passed to the RowMapper
. Defaults
to true.verifyCursorPosition
- indicatorAbstractCursorItemReader.setVerifyCursorPosition(boolean)
public JdbcCursorItemReaderBuilder<T> driverSupportsAbsolute(boolean driverSupportsAbsolute)
ResultSet
.driverSupportsAbsolute
- indicatorAbstractCursorItemReader.setDriverSupportsAbsolute(boolean)
public JdbcCursorItemReaderBuilder<T> useSharedExtendedConnection(boolean useSharedExtendedConnection)
useSharedExtendedConnection
- indicatorAbstractCursorItemReader.setUseSharedExtendedConnection(boolean)
public JdbcCursorItemReaderBuilder<T> preparedStatementSetter(org.springframework.jdbc.core.PreparedStatementSetter preparedStatementSetter)
PreparedStatementSetter
to be used to populate any
arguments in the SQL query to be executed for the reader.preparedStatementSetter
- setterJdbcCursorItemReader.setPreparedStatementSetter(PreparedStatementSetter)
public JdbcCursorItemReaderBuilder<T> queryArguments(java.lang.Object[] args)
PreparedStatementSetter
that will use the array as the values
to be set on the query to be executed for this reader.args
- values to set on the reader querypublic JdbcCursorItemReaderBuilder<T> queryArguments(java.lang.Object[] args, int[] types)
PreparedStatementSetter
that will use the Object [] as the
values to be set on the query to be executed for this reader. The int[] will
provide the types (Types
) for each of the values provided.args
- values to set on the querytypes
- the type for each value in the args arraypublic JdbcCursorItemReaderBuilder<T> queryArguments(java.util.List<?> args) throws java.lang.Exception
PreparedStatementSetter
that will use the List as the values
to be set on the query to be executed for this reader.args
- values to set on the queryjava.lang.Exception
- from InitializingBean.afterPropertiesSet()
public JdbcCursorItemReaderBuilder<T> sql(java.lang.String sql)
sql
- queryJdbcCursorItemReader.setSql(String)
public JdbcCursorItemReaderBuilder<T> rowMapper(org.springframework.jdbc.core.RowMapper<T> rowMapper)
RowMapper
used to map the results of the cursor to each item.rowMapper
- RowMapper
JdbcCursorItemReader.setRowMapper(RowMapper)
public JdbcCursorItemReaderBuilder<T> beanRowMapper(java.lang.Class<T> mappedClass)
BeanPropertyRowMapper
to be used as your
RowMapper
.mappedClass
- the class for the row mapperBeanPropertyRowMapper
public JdbcCursorItemReader<T> build()
JdbcCursorItemReader