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

jobs.skipSampleJob.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:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:aop="http://www.springframework.org/schema/aop"
	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">

	<import resource="tradeJobIo.xml" />

	<bean id="skipJob" parent="simpleJob">
		<property name="steps">
			<list>
				<bean id="step1" parent="skipLimitStep">
					<property name="skipLimit" value="1" />
					<property name="itemReader" ref="fileItemReader" />
					<property name="itemProcessor">
						<bean
							class="org.springframework.batch.sample.domain.trade.internal.TradeProcessor"
							p:validationFailure="3" />
					</property>
					<property name="itemWriter">
						<bean
							class="org.springframework.batch.sample.domain.trade.internal.TradeWriter"
							p:dao-ref="tradeDao" />
					</property>
				</bean>
				<bean id="step2" parent="skipLimitStep">
					<property name="commitInterval" value="2" />
					<property name="skipLimit" value="1" />
					<!-- No rollback for exceptions that are marked with "+" in the tx attributes -->
					<property name="skippableExceptionClasses">
			            <list>
			                <value>org.springframework.batch.item.validator.ValidationException</value>
			            </list>
					</property>
					<property name="itemReader"
						ref="tradeSqlItemReader" />
					<property name="itemProcessor">
						<bean
							class="org.springframework.batch.sample.domain.trade.internal.TradeProcessor"
							p:validationFailure="2" />
					</property>
					<property name="itemWriter"
						ref="itemTrackingWriter" />
				</bean>
			</list>
		</property>
	</bean>

	<bean id="itemTrackingWriter"
		class="org.springframework.batch.sample.support.ItemTrackingItemWriter" />

	<bean id="tradeSqlItemReader"
		class="org.springframework.batch.item.database.JdbcCursorItemReader">
		<property name="dataSource" ref="dataSource" />
		<property name="sql"
			value="SELECT isin, quantity, price, customer from TRADE" />
		<property name="mapper">
			<bean
				class="org.springframework.batch.sample.domain.trade.internal.TradeRowMapper" />
		</property>
	</bean>

	<bean id="customerSqlItemReader"
		class="org.springframework.batch.item.database.JdbcCursorItemReader">
		<property name="dataSource" ref="dataSource" />
		<property name="sql"
			value="SELECT id, name, credit FROM customer " />
		<property name="mapper">
			<bean
				class="org.springframework.batch.sample.domain.trade.internal.CustomerCreditRowMapper" />
		</property>
	</bean>

	<bean id="fileLocator"
		class="org.springframework.core.io.ClassPathResource">
		<constructor-arg type="java.lang.String"
			value="data/tradeJob/input/20070122.teststream.ImportTradeDataStep.txt" />
	</bean>

	<bean id="customerFileLocator"
		class="org.springframework.core.io.FileSystemResource">
		<constructor-arg type="java.lang.String"
			value="target/test-outputs/20070122.testStream.CustomerReportStep.TEMP.txt" />
	</bean>

</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy