Is using a OneToManyResultSetExtractor/ResultSetExtractor with Spring Batch's JdbcCursorItemReader possible? -
i wondering whether using onetomanyresultsetextractor
or resultsetextractor
spring batch's jdbccursoritemreader
?
the issue have expected rowmapper
deals 1 object per row , have join sql query returns many rows per object.
out of box, not support use of resultsetextractor
. reason wrapping itemreader
stateful , needs able keep track of how many rows have been consumed (it wouldn't know otherwise). way type of functionality typically done in spring batch using itemprocessor
enrich object. itemreader
return 1 (of 1 many) , itemprocessor
enrich object many. common pattern in batch processing called driving query pattern. can read more in spring batch documentation here: http://docs.spring.io/spring-batch/trunk/reference/html/patterns.html
that being said, wrap jdbccursoritemreader
own implementation performs logic of aggregation you.
Comments
Post a Comment