|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 org.apache.commons.logging.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(org.springframework.orm.ibatis.SqlMapClientTemplate sqlMapClientTemplate)
Public setter for the SqlMapClientTemplate. |
void |
setStatementId(java.lang.String statementId)
Public setter for the statement id identifying the statement in the SqlMap configuration file. |
void |
write(java.util.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 org.apache.commons.logging.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(org.springframework.orm.ibatis.SqlMapClientTemplate sqlMapClientTemplate)
SqlMapClientTemplate.
sqlMapClientTemplate - the SqlMapClientTemplatepublic void setStatementId(java.lang.String statementId)
statementId - the id for the statement
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exception
public void write(java.util.List<? extends T> items)
throws java.lang.Exception
ItemWriter
write in interface ItemWriter<T>java.lang.Exception - if there are errors. The framework will catch the
exception and convert or rethrow it as appropriate.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||