BATCH-965: renamed batch writer to JdbcBatchItemWriter and added named parameter support, added JPA and Hibernate writers

This commit is contained in:
trisberg
2008-12-11 17:47:35 +00:00
parent 91a0df5ba7
commit e8ef2ae31d
4 changed files with 7 additions and 7 deletions

View File

@@ -22,8 +22,8 @@
</property>
</bean>
<bean id="itemWriter" class="org.springframework.batch.item.database.BatchSqlUpdateItemWriter">
<property name="jdbcTemplate" ref="jdbcTemplate" />
<bean id="itemWriter" class="org.springframework.batch.item.database.JdbcBatchItemWriter">
<property name="dataSource" ref="dataSource" />
<property name="sql">
<util:constant static-field="org.springframework.batch.sample.domain.trade.internal.CustomerCreditUpdatePreparedStatementSetter.QUERY"/>
</property>
@@ -31,7 +31,7 @@
<bean class="org.springframework.batch.sample.domain.trade.internal.CustomerCreditUpdatePreparedStatementSetter" />
</property>
</bean>
<bean id="itemReader" class="org.springframework.batch.item.database.JdbcCursorItemReader">
<property name="dataSource" ref="dataSource" />
<property name="sql" value="SELECT id, name, credit FROM customer " />

View File

@@ -135,10 +135,10 @@ Spring Batch Samples
* Batch Update ({batchUpdate})
The purpose of this sample is to show to usage of the
<<<BatchSqlUpdateItemWriter>>> to make efficient updates to a
<<<JdbcBatchItemWriter>>> to make efficient updates to a
database table.
The <<<BatchSqlUpdateItemWriter>>> accepts a special form of
The <<<JdbcBatchItemWriter>>> accepts a special form of
<<<PreparedStatementSetter>>> as a (mandatory) dependency. This is
responsible for copying fields from the item to be written to a
<<<PreparedStatement>>> matching the SQL query that has been

View File

@@ -5,12 +5,12 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Test for BatchSqlUpdateJob - checks that customer credit has been updated to expected value.
* Test for JdbcBatchItemWriterJob - checks that customer credit has been updated to expected value.
*
* @author Robert Kasanicky
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class BatchSqlUpdateJobFunctionalTests extends AbstractCustomerCreditIncreaseTests {
public class JdbcBatchJobFunctionalTests extends AbstractCustomerCreditIncreaseTests {
}