谁调用类AbstractItemCountingItemStreamItemReader的doopen函数

时间:2019-08-07 17:37:50

标签: spring-batch

我知道spring批处理框架何时调用JdbcCursorItemReader的read函数,但在此之前,它首先应该调用doopen函数,spring batch框架在哪里调用doopen函数?

@Bean
 public JdbcCursorItemReader<User> reader(){
  JdbcCursorItemReader<User> reader = new JdbcCursorItemReader<User>();
  reader.setDataSource(dataSource);
  reader.setSql("SELECT id,name FROM user");
  reader.setRowMapper(new UserRowMapper());

  return reader;
 }

 @Bean
 public Step step1() {
  return stepBuilderFactory.get("step1").<User, User> chunk(10)
.reader(reader())
.processor(processor())
.writer(writer())
.build();
 }

0 个答案:

没有答案