|
1 | | -<beans xmlns="http://www.springframework.org/schema/beans" |
2 | | - xmlns:batch="http://www.springframework.org/schema/batch" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 1 | +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:batch="http://www.springframework.org/schema/batch" |
| 2 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
3 | 3 | xsi:schemaLocation="http://www.springframework.org/schema/batch |
4 | | - http://www.springframework.org/schema/batch/spring-batch-3.0.xsd |
5 | | - http://www.springframework.org/schema/beans |
6 | | - http://www.springframework.org/schema/beans/spring-beans-4.2.xsd |
7 | | - "> |
| 4 | + http://www.springframework.org/schema/batch/spring-batch-3.0.xsd |
| 5 | + http://www.springframework.org/schema/beans |
| 6 | + http://www.springframework.org/schema/beans/spring-beans-4.2.xsd |
| 7 | +"> |
8 | 8 |
|
9 | 9 | <import resource="spring.xml" /> |
10 | 10 |
|
11 | | - <bean id="itemReader" |
12 | | - class="org.springframework.batch.item.file.FlatFileItemReader"> |
13 | | - |
| 11 | + <bean id="itemReader" class="org.springframework.batch.item.file.FlatFileItemReader"> |
14 | 12 | <property name="resource" value="input/record.csv" /> |
15 | | - |
16 | 13 | <property name="lineMapper"> |
17 | 14 | <bean |
18 | 15 | class="org.springframework.batch.item.file.mapping.DefaultLineMapper"> |
19 | 16 | <property name="lineTokenizer"> |
20 | 17 | <bean |
21 | 18 | class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer"> |
22 | 19 | <property name="names" |
23 | | - value="username,userid,transactiondate,amount" /> |
| 20 | + value="username,userid,transaction_date,transaction_amount" /> |
24 | 21 | </bean> |
25 | 22 | </property> |
26 | 23 | <property name="fieldSetMapper"> |
27 | 24 | <bean |
28 | 25 | class="org.baeldung.spring_batch_intro.service.RecordFieldSetMapper" /> |
29 | | - |
30 | 26 | </property> |
31 | 27 | </bean> |
32 | 28 | </property> |
| 29 | + <property name="linesToSkip" value="1" /> |
33 | 30 | </bean> |
34 | 31 |
|
35 | | - <bean id="itemProcessor" |
36 | | - class="org.baeldung.spring_batch_intro.service.CustomItemProcessor" /> |
| 32 | + <bean id="itemProcessor" class="org.baeldung.spring_batch_intro.service.CustomItemProcessor" /> |
37 | 33 |
|
38 | | - <bean id="itemWriter" |
39 | | - class="org.springframework.batch.item.xml.StaxEventItemWriter"> |
| 34 | + <bean id="itemWriter" class="org.springframework.batch.item.xml.StaxEventItemWriter"> |
40 | 35 | <property name="resource" value="file:xml/output.xml" /> |
41 | 36 | <property name="marshaller" ref="recordMarshaller" /> |
42 | 37 | <property name="rootTagName" value="transactionRecord" /> |
|
45 | 40 | <bean id="recordMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> |
46 | 41 | <property name="classesToBeBound"> |
47 | 42 | <list> |
48 | | - <value>org.baeldung.spring_batch_intro.model.Transaction |
49 | | - </value> |
| 43 | + <value>org.baeldung.spring_batch_intro.model.Transaction</value> |
50 | 44 | </list> |
51 | 45 | </property> |
52 | 46 | </bean> |
53 | 47 |
|
54 | | - |
55 | 48 | <batch:job id="firstBatchJob"> |
56 | 49 | <batch:step id="step1"> |
57 | 50 | <batch:tasklet> |
|
0 commit comments