public class IbatisBatchItemWriter<T> extends Object implements ItemWriter<T>, org.springframework.beans.factory.InitializingBean
ItemWriter that uses the batching features from
SqlMapClientTemplate to execute a batch of statements for all items
provided.write(List) is called inside a transaction.| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
IbatisBatchItemWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Check mandatory properties - there must be an SqlMapClient and a statementId.
|
void |
setAssertUpdates(boolean assertUpdates)
Public setter for the flag that determines whether an assertion is made
that all items cause at least one row to be updated.
|
void |
setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
Public setter for
SqlMapClient for injection purposes. |
void |
setSqlMapClientTemplate(org.springframework.orm.ibatis.SqlMapClientTemplate sqlMapClientTemplate)
Public setter for the SqlMapClientTemplate.
|
void |
setStatementId(String statementId)
Public setter for the statement id identifying the statement in the SqlMap
configuration file.
|
void |
write(List<? extends T> items)
Process the supplied data element.
|
public void setAssertUpdates(boolean assertUpdates)
assertUpdates - the flag to set. Defaults to true;public void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
SqlMapClient for injection purposes.sqlMapClient - the SqlMapClientpublic void setSqlMapClientTemplate(org.springframework.orm.ibatis.SqlMapClientTemplate sqlMapClientTemplate)
sqlMapClientTemplate - the SqlMapClientTemplatepublic void setStatementId(String statementId)
statementId - the id for the statementpublic void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void write(List<? extends T> items)
ItemWriterwrite in interface ItemWriter<T>Copyright © 2014 Pivotal. All rights reserved.