public class JdbcBatchItemWriterBuilder<T>
extends java.lang.Object
JdbcBatchItemWriter
.JdbcBatchItemWriter
Constructor and Description |
---|
JdbcBatchItemWriterBuilder() |
Modifier and Type | Method and Description |
---|---|
JdbcBatchItemWriterBuilder<T> |
assertUpdates(boolean assertUpdates)
If set to true, confirms that every insert results in the update of at least one
row in the database.
|
JdbcBatchItemWriterBuilder<T> |
beanMapped()
Creates a
BeanPropertyItemSqlParameterSourceProvider to be used as your
ItemSqlParameterSourceProvider . |
JdbcBatchItemWriter<T> |
build()
Validates configuration and builds the
JdbcBatchItemWriter . |
JdbcBatchItemWriterBuilder<T> |
columnMapped()
Creates a
ColumnMapItemPreparedStatementSetter to be used as your
ItemPreparedStatementSetter . |
JdbcBatchItemWriterBuilder<T> |
dataSource(javax.sql.DataSource dataSource)
Configure the
DataSource to be used. |
JdbcBatchItemWriterBuilder<T> |
itemPreparedStatementSetter(ItemPreparedStatementSetter<T> itemPreparedStatementSetter)
Configures a
ItemPreparedStatementSetter for use by the writer. |
JdbcBatchItemWriterBuilder<T> |
itemSqlParameterSourceProvider(ItemSqlParameterSourceProvider<T> itemSqlParameterSourceProvider)
Configures a
ItemSqlParameterSourceProvider for use by the writer. |
JdbcBatchItemWriterBuilder<T> |
namedParametersJdbcTemplate(org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations namedParameterJdbcOperations)
The
NamedParameterJdbcOperations instance to use. |
JdbcBatchItemWriterBuilder<T> |
sql(java.lang.String sql)
Set the SQL statement to be used for each item's updates.
|
public JdbcBatchItemWriterBuilder<T> dataSource(javax.sql.DataSource dataSource)
DataSource
to be used.dataSource
- the DataSourceJdbcBatchItemWriter.setDataSource(DataSource)
public JdbcBatchItemWriterBuilder<T> assertUpdates(boolean assertUpdates)
assertUpdates
- boolean indicatorJdbcBatchItemWriter.setAssertUpdates(boolean)
public JdbcBatchItemWriterBuilder<T> sql(java.lang.String sql)
sql
- SQL stringJdbcBatchItemWriter.setSql(String)
public JdbcBatchItemWriterBuilder<T> itemPreparedStatementSetter(ItemPreparedStatementSetter<T> itemPreparedStatementSetter)
ItemPreparedStatementSetter
for use by the writer. This
should only be used if columnMapped()
isn't called.itemPreparedStatementSetter
- The ItemPreparedStatementSetter
JdbcBatchItemWriter.setItemPreparedStatementSetter(ItemPreparedStatementSetter)
public JdbcBatchItemWriterBuilder<T> itemSqlParameterSourceProvider(ItemSqlParameterSourceProvider<T> itemSqlParameterSourceProvider)
ItemSqlParameterSourceProvider
for use by the writer. This
should only be used if beanMapped()
isn't called.itemSqlParameterSourceProvider
- The ItemSqlParameterSourceProvider
JdbcBatchItemWriter.setItemSqlParameterSourceProvider(ItemSqlParameterSourceProvider)
public JdbcBatchItemWriterBuilder<T> namedParametersJdbcTemplate(org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations namedParameterJdbcOperations)
NamedParameterJdbcOperations
instance to use. If one isn't provided,
a DataSource
is required.namedParameterJdbcOperations
- The templatepublic JdbcBatchItemWriterBuilder<T> columnMapped()
ColumnMapItemPreparedStatementSetter
to be used as your
ItemPreparedStatementSetter
.
NOTE: The item type for this ItemWriter
must
be castable to Map<String,Object>>
.ColumnMapItemPreparedStatementSetter
public JdbcBatchItemWriterBuilder<T> beanMapped()
BeanPropertyItemSqlParameterSourceProvider
to be used as your
ItemSqlParameterSourceProvider
.BeanPropertyItemSqlParameterSourceProvider
public JdbcBatchItemWriter<T> build()
JdbcBatchItemWriter
.JdbcBatchItemWriter