All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jobs.ibatisJob.xml Maven / Gradle / Ivy

There is a newer version: 1.1.4.RELEASE
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:p="http://www.springframework.org/schema/p"
	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-2.0.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

	<description>Example for iBATIS integration.</description>

	<bean id="ibatisJob" parent="simpleJob">
		<property name="steps">
			<bean id="step1" parent="simpleStep">
				<property name="itemReader" ref="ibatisItemReader" />
				<property name="itemProcessor">
					<bean class="org.springframework.batch.sample.domain.trade.internal.CustomerCreditIncreaseProcessor" />	
				</property>
				<property name="itemWriter">
					<bean
						class="org.springframework.batch.sample.domain.trade.internal.CustomerCreditItemWriter">
						<property name="customerCreditDao">
							<bean
								class="org.springframework.batch.sample.domain.trade.internal.IbatisCustomerCreditDao">
								<property name="sqlMapClient"
									ref="sqlMapClient" />
								<property name="statementId"
									value="updateCredit" />
							</bean>
						</property>
					</bean>
				</property>
			</bean>
		</property>
	</bean>

	<bean id="ibatisItemReader"
		class="org.springframework.batch.item.database.IbatisDrivingQueryItemReader">
		<property name="detailsQueryId" value="getCustomerCreditById" />
		<property name="sqlMapClient" ref="sqlMapClient" />
		<property name="keyCollector" ref="ibatisKeyGenerator" />
	</bean>

	<bean id="ibatisKeyGenerator"
		class="org.springframework.batch.item.database.support.IbatisKeyCollector">
		<property name="drivingQueryId" value="getAllCustomerCreditIds" />
		<property name="sqlMapClient" ref="sqlMapClient" />
	</bean>

	<bean id="sqlMapClient"
		class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
		<property name="configLocation" value="ibatis-config.xml" />
		<property name="dataSource" ref="dataSource" />
	</bean>

</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy