BATCH-1464: remove Exception from writer signature where it is not needed
This commit is contained in:
@@ -66,7 +66,7 @@ public class HibernateItemWriter<T> implements ItemWriter<T>, InitializingBean {
|
||||
/**
|
||||
* Check mandatory properties - there must be a hibernateTemplate.
|
||||
*/
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(hibernateTemplate, "HibernateItemWriter requires a HibernateOperations");
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class HibernateItemWriter<T> implements ItemWriter<T>, InitializingBean {
|
||||
*
|
||||
* @see org.springframework.batch.item.ItemWriter#write(java.util.List)
|
||||
*/
|
||||
public final void write(List<? extends T> items) throws Exception {
|
||||
public final void write(List<? extends T> items) {
|
||||
doWrite(hibernateTemplate, items);
|
||||
try {
|
||||
hibernateTemplate.flush();
|
||||
|
||||
@@ -102,7 +102,7 @@ public class IbatisBatchItemWriter<T> implements ItemWriter<T>, InitializingBean
|
||||
/**
|
||||
* Check mandatory properties - there must be an SqlMapClient and a statementId.
|
||||
*/
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(sqlMapClientTemplate, "A SqlMapClient or a SqlMapClientTemplate is required.");
|
||||
Assert.notNull(statementId, "A statementId is required.");
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class IbatisBatchItemWriter<T> implements ItemWriter<T>, InitializingBean
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.item.ItemWriter#write(java.util.List)
|
||||
*/
|
||||
public void write(final List<? extends T> items) throws Exception {
|
||||
public void write(final List<? extends T> items) {
|
||||
|
||||
if (!items.isEmpty()) {
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ public class JdbcBatchItemWriter<T> implements ItemWriter<T>, InitializingBean {
|
||||
* Check mandatory properties - there must be a SimpleJdbcTemplate and an SQL statement plus a
|
||||
* parameter source.
|
||||
*/
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(simpleJdbcTemplate, "A DataSource or a SimpleJdbcTemplate is required.");
|
||||
Assert.notNull(sql, "An SQL statement is required.");
|
||||
List<String> namedParameters = new ArrayList<String>();
|
||||
|
||||
@@ -74,7 +74,7 @@ public class JpaItemWriter<T> implements ItemWriter<T>, InitializingBean {
|
||||
*
|
||||
* @see org.springframework.batch.item.ItemWriter#write(java.util.List)
|
||||
*/
|
||||
public final void write(List<? extends T> items) throws Exception {
|
||||
public final void write(List<? extends T> items) {
|
||||
EntityManager entityManager = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory);
|
||||
if (entityManager == null) {
|
||||
throw new DataAccessResourceFailureException("Unable to obtain a transactional EntityManager");
|
||||
|
||||
Reference in New Issue
Block a user