Pull in code blocks with {!include:...} syntax
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- {!begin#shade-config} -->
|
||||
<properties>
|
||||
<start-class>hello.BatchConfiguration</start-class>
|
||||
</properties>
|
||||
@@ -36,6 +37,7 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<!-- {!end#shade-config} -->
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.springframework.jdbc.core.RowMapper;
|
||||
@EnableAutoConfiguration
|
||||
public class BatchConfiguration {
|
||||
|
||||
// {!begin#reader-writer-processor}
|
||||
@Bean
|
||||
public ItemReader<Person> reader() {
|
||||
FlatFileItemReader<Person> reader = new FlatFileItemReader<Person>();
|
||||
@@ -63,7 +64,9 @@ public class BatchConfiguration {
|
||||
writer.setDataSource(dataSource);
|
||||
return writer;
|
||||
}
|
||||
// {!end#reader-writer-processor}
|
||||
|
||||
// {!begin#job-step}
|
||||
@Bean
|
||||
public Job importUserJob(JobBuilderFactory jobs, Step s1) {
|
||||
return jobs.get("importUserJob")
|
||||
@@ -83,7 +86,9 @@ public class BatchConfiguration {
|
||||
.writer(writer)
|
||||
.build();
|
||||
}
|
||||
// {!end#job-step}
|
||||
|
||||
// {!begin#template-main}
|
||||
@Bean
|
||||
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
|
||||
return new JdbcTemplate(dataSource);
|
||||
@@ -101,5 +106,5 @@ public class BatchConfiguration {
|
||||
System.out.println("Found <" + person + "> in the database.");
|
||||
}
|
||||
}
|
||||
|
||||
// {!end#template-main}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user