I am new to Spring Batch
version 3.0.6.RELEASE
. I developed spring project which reads data from mysql
database and writes to CSV
file. My database table has many columns and in order to read that I need to write all columns names. What is the way to get all columns name in ?
<bean id="flatFileItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter"
scope="step">
<property name="resource" value="file:csv/customers.txt" />
<property name="lineAggregator">
<!-- An Aggregator which converts an object into delimited list of strings -->
<bean
class="org.springframework.batch.item.file.transform.DelimitedLineAggregator">
<property name="delimiter" value="|" />
<property name="fieldExtractor">
<!-- Extractor which returns the value of beans property through reflection -->
<bean class="org.springframework.batch.item.file.transform.BeanWrapperFieldExtractor">
<property name="names"
value="customerNumber,customerName,contactLastName,contactFirstName,
phone,addressLine1,addressLine2,city,state,postalCode,country,salesRepEmployeeNumber,creditLimit" />
</bean>
</property>
</bean>
</property>
</bean>
I don't want to write each column names there. What do I need to change?