How to levarage spring batch without using POJO?

。_饼干妹妹 提交于 2019-12-02 16:09:56

问题


I know BeanWrapperFieldSetMapper class depends on POJO. But here is the thing: If I want to take advantage of Spring Batch features but do not want to create separate jobs ( does not want to write POJOs and separate reader writes or mappers) how to do this?

My requirement is to read *.csv file which will have the headers so I should be able to supply header names in a map or string[] and create my sql statement based on it, instead of writing a RowMapper. This will help me uploading various files to different tables. Is it possible to change BeanWrapperFieldSetMapper to make it suitable to map the values from Map or String[]?

Also Even if I do not have headers in the *.cvs file, I can construct update statement and load using chunk delimeters setting and other advantages of Spring Batch.

来源:https://stackoverflow.com/questions/37551040/how-to-levarage-spring-batch-without-using-pojo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!