|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.item.database.IbatisBatchItemWriter<T>
public class IbatisBatchItemWriter<T>
ItemWriter
that uses the batching features from
SqlMapClientTemplate
to execute a batch of statements for all items
provided.
The user must provide an iBATIS statement id that points to the SQL statement defined
in the iBATIS SqlMap configuration.
It is expected that write(List)
is called inside a transaction.
The writer is thread safe after its properties are set (normal singleton
behavior), so it can be used to write in multiple concurrent transactions.
Field Summary | |
---|---|
protected static Log |
logger
|
Constructor Summary | |
---|---|
IbatisBatchItemWriter()
|
Method Summary | |
---|---|
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(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Log logger
Constructor Detail |
---|
public IbatisBatchItemWriter()
Method Detail |
---|
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(SqlMapClientTemplate sqlMapClientTemplate)
SqlMapClientTemplate
.
sqlMapClientTemplate
- the SqlMapClientTemplatepublic void setStatementId(String statementId)
statementId
- the id for the statementpublic void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public void write(List<? extends T> items)
ItemWriter
write
in interface ItemWriter<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |