英語 での Itemreader の使用例とその 日本語 への翻訳
{-}
-
Colloquial
-
Ecclesiastic
-
Computer
-
Programming
ItemReader ItemProcessor.
The step obtains input data from ItemReader.
ItemReader returns the input data to the step.
The basic setting is the same as ItemReader of MyBatis.
For the details of ItemReader, refer to Database access and File access.
MyBatis-Spring provides the following two ItemReader.
Implementation class of ItemReader to use for loading flat files.
The internal management table remembers the number committed by ItemReader.
Another example is shown when ItemReader and ItemWriter are used at the same time.
Access input resources(flat files in this example) through ItemReader.
In Job2, ItemReader which reads from the file is defined by a Bean ID- reader.
Define the type as ItemStreamReader that is sub-interface of ItemReader.
Create a class that implements the ItemReader interface provided by Spring Batch.
ItemReader read returns null when it reads all the input data and reaches the end.
Next, explanation is given about how ChunkOrientedTasklet calls the ItemReader, ItemProcessor and ItemWriter.
In Job1, ItemReader which reads from the database is defined by a Bean ID- reader.
However, when a file of specific format is to be input or output,a concrete class which implements individual ItemReader or ItemWriter can be created and used.
MyItemReader Create a class that implements the ItemReader interface provided by Spring Batch.
Default value of character code of the components offered by Spring Batch varies for ItemReader and ItemWriter(Default value of ItemReader is"default character set of JavaVM").
ItemReader・ ItemWriter use the Mapper interface In using the Mapper interface TERASOLUNA Batch 5 x.
Because of the structure of Spring Batch, ItemReader is based on the premise that it retriedves a process target record from one resource.
ItemReader, ItemProcessor and ItemWriter implementation and number of chunks are set in ChunkOrientedTasklet.
ChunkOrientedTasklet repeatedly executes ItemReader and ItemProcessor by the chunk size, in other words, reading and processing of data.
ItemReader and ItemWriter which are components of the chunk model can also be used as components as the advanced implementation means.
Specify Bean ID of ItemReader and ItemWriter defined in the previous section, in respective reader and writer attributes.
Next, ItemReader, ItemProcessor and ItemWriter which are responsible for actual processing in chunk processing are introduced.
To use ItemReader bean defined in implementation class of Tasklet, refer to Creating a tasklet-oriented job.
When using ItemReader and ItemWriter provided by MyBatis-Spring, it is necessary to set Mapper XML used in Mapper's Config.
The resource of ItemReader delegated from MultiResourceItemReader is automatically set from MultiResourceItemReader, so setting in the bean definition is unnecessary.
Since resource of ItemReader delegated from MultiResourceItemReader is automatically set from MultiResourceItemReader, it is not necessary to set it in Bean definition.