langmi / spring-batch-examples-readers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

composite writter issue

opened this issue · comments

I am newbie to the spring batch and following your tutorials which are awesome. I am using following composite configurations, but it returns me the Object reference and not the actual value. How to solve it?

<bean id="itemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter" scope="step"> <property name="resource" value="#{jobParameters['output.file']}" /> <property name="lineAggregator"> <bean class="org.springframework.batch.item.file.transform.DelimitedLineAggregator"> <property name="fieldExtractor"> <bean class="org.springframework.batch.item.file.transform.PassThroughFieldExtractor" /> </property> </bean> </property> </bean>

it works for me, when i replace the itemwriter config in https://github.com/langmi/spring-batch-examples-readers/blob/master/src/main/resources/spring/batch/job/readers/file/file-composite-job.xml with your code fragment
can you please share your complete jobconfig?

Hey, thanks for reply. Please see below complete file. When I run MainApp then only references are getting printed. Please see below. I am looking to write two tables data into single/common flat file. Please help/guide.

if you just copied over the DefaultUnifyingStringItemsMapper, then you need to implement the toString method in your items (PatientMaritalStatus / PatientDetails)