
jobs.tradeJobIo.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-batch-samples
Show all versions of spring-batch-samples
Example batch jobs using Spring Batch Core and Execution.
<?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.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> <bean class="org.springframework.batch.sample.domain.trade.internal.JdbcTradeDao" id="tradeDao" p:dataSource-ref="dataSource"> <property name="incrementer"> <bean parent="incrementerParent"> <property name="incrementerName" value="TRADE_SEQ" /> </bean> </property> </bean> <bean class="org.springframework.batch.sample.domain.trade.internal.JdbcCustomerDebitDao" id="customerDao" p:dataSource-ref="dataSource" /> <bean class="org.springframework.batch.sample.domain.trade.internal.FlatFileCustomerCreditDao" id="customerReportItemWriter"> <property name="itemWriter"> <bean class="org.springframework.batch.item.file.FlatFileItemWriter" id="customerFlatFileOutputSource"> <property name="resource" ref="customerFileLocator" /> <property name="lineAggregator"> <bean class="org.springframework.batch.item.file.transform.PassThroughLineAggregator" /> </property> </bean> </property> </bean> <bean class="org.springframework.batch.item.file.FlatFileItemReader" id="fileItemReader"> <property name="resource" ref="fileLocator" /> <property name="lineMapper"> <bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper"> <property name="lineTokenizer" ref="tradeFileDescriptor" /> <property name="fieldSetMapper"> <bean class="org.springframework.batch.sample.domain.trade.internal.TradeFieldSetMapper" /> </property> </bean> </property> </bean> <bean id="tradeFileDescriptor" class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer"> <property name="names" value="ISIN, Quantity, Price, Customer" /> </bean> <bean id="tradeValidator" class="org.springframework.batch.item.validator.SpringValidator"> <property name="validator"> <bean class="org.springmodules.validation.valang.ValangValidator"> <property name="valang"> <value> <![CDATA[ { isin : length(?) < 13 : 'ISIN too long' : 'isin_length' : 12} ]]> </value> </property> </bean> </property> </bean> </beans>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy