Skip to content

Commit 1c37e4d

Browse files
committed
Docs polishing
1 parent ab0bc51 commit 1c37e4d

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/site/markdown/docs/springBatch.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,36 @@ MyBatis Dynamic SQL provides utilities for each of these requirements. Each util
2424
MyBatis Dynamic SQL provides a specialized rendering strategy for queries used with the MyBatis Spring `ItemReader` implementations. Queries should be rendered as follows:
2525

2626
```java
27-
SelectStatementProvider selectStatement = SelectDSL.select(person.allColumns())
28-
.from(person)
29-
.where(lastName, isEqualTo("flintstone"))
30-
.build()
31-
.render(SpringBatchUtility.SPRING_BATCH_READER_RENDERING_STRATEGY);
27+
SelectStatementProvider selectStatement = SelectDSL.select(person.allColumns())
28+
.from(person)
29+
.where(lastName, isEqualTo("flintstone"))
30+
.build()
31+
.render(SpringBatchUtility.SPRING_BATCH_READER_RENDERING_STRATEGY); // render for Spring Batch
3232
```
3333

3434
### Creating the Parameter Map
3535

3636
The `SpringBatchUtility` provides a method to create the parameter values Map needed by the MyBatis Spring `ItemReader`. It can be used as follows:
3737

3838
```java
39-
MyBatisCursorItemReader<Person> reader = new MyBatisCursorItemReader<>();
40-
reader.setQueryId(PersonMapper.class.getName() + ".selectMany");
41-
reader.setSqlSessionFactory(sqlSessionFactory);
42-
reader.setParameterValues(SpringBatchUtility.toParameterValues(selectStatement));
39+
MyBatisCursorItemReader<Person> reader = new MyBatisCursorItemReader<>();
40+
reader.setQueryId(PersonMapper.class.getName() + ".selectMany");
41+
reader.setSqlSessionFactory(sqlSessionFactory);
42+
reader.setParameterValues(SpringBatchUtility.toParameterValues(selectStatement)); // create parameter map
4343
```
4444

4545
### Specialized @SelectProvider Adapter
4646

47-
MyBatis mappers should be configured to use the specialized `@SelectProvider` adapter as follows:
47+
MyBatis mapper methods should be configured to use the specialized `@SelectProvider` adapter as follows:
4848

4949
```java
50-
@SelectProvider(type=SpringBatchProviderAdapter.class, method="select")
51-
@Results({
52-
@Result(column="id", property="id", id=true),
53-
@Result(column="first_name", property="firstName"),
54-
@Result(column="last_name", property="lastName")
55-
})
56-
List<Person> selectMany(Map<String, Object> parameterValues);
50+
@SelectProvider(type=SpringBatchProviderAdapter.class, method="select") // use the Spring batch adapter
51+
@Results({
52+
@Result(column="id", property="id", id=true),
53+
@Result(column="first_name", property="firstName"),
54+
@Result(column="last_name", property="lastName")
55+
})
56+
List<Person> selectMany(Map<String, Object> parameterValues);
5757
```
5858

5959
## Complete Example

0 commit comments

Comments
 (0)