<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:batch="http://www.springframework.org/schema/batch"
	xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
       		http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
       		http://www.springframework.org/schema/batch
       		http://www.springframework.org/schema/batch/spring-batch-2.2.xsd">

	<job id="pssJob" xmlns="http://www.springframework.org/schema/batch">
		<step id="step1">
			<tasklet>
				<chunk reader="reader" writer="writer" commit-interval="1"/>
			</tasklet>
		</step>
	</job>

	<batch:job-repository id="jobRepository"/>

	<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
		<property name="jobRepository" ref="jobRepository" />
	</bean>

	<bean id="reader" class="org.springframework.batch.item.database.JdbcCursorItemReader">
		<property name="sql" value="select ID, NAME, VALUE from FOO where ID &gt;= ? and ID &lt;= ?"/>
		<property name="preparedStatementSetter" ref="pss"/>
		<property name="dataSource" ref="dataSource"/>
		<property name="rowMapper">
			<bean class="org.springframework.batch.core.resource.FooRowMapper"/>
		</property>
	</bean>

	<bean id="pss" class="org.springframework.batch.core.resource.ListPreparedStatementSetter" scope="step">
		<property name="parameters">
			<list>
				<value>#{jobParameters['min.id']}</value>
				<value>#{jobParameters['max.id']}</value>
			</list>
		</property>
	</bean>

	<bean id="writer" class="org.springframework.batch.core.resource.ListPreparedStatementSetterTests$FooStoringItemWriter"/>

</beans>