@@ -70,8 +70,8 @@ SelectStatementProvider selectStatement = SpringBatchUtility.selectForCursor(pe
70
70
.render();
71
71
```
72
72
73
- That utility method was limited in capability. The new method allows the full capabilities of the library. To migrate,
74
- follow these steps:
73
+ That utility method was limited in capability and has been removed . The new method described above allows the full
74
+ capabilities of the library. To migrate, follow these steps:
75
75
76
76
1 . Replace ` SpringBatchUtility.selectForCursor(...) ` with ` SqlBuilder.select(...) `
77
77
2 . Replace ` render() ` with ` render(RenderingStrategies.MYBATIS3) `
@@ -114,6 +114,26 @@ Notice the following important items:
114
114
2 . The query must be rendered with the ` SPRING_BATCH_PAGING_ITEM_READER_RENDERING_STRATEGY ` rendering strategy. This
115
115
rendering strategy will render the query so that it will respond properly to the runtime values supplied for page size
116
116
and skip rows.
117
+ 3 . Note the use of ` SpringBatchUtility.toParameterValues(...) ` . This utility will set up the parameter Map correctly for
118
+ the rendered statement, and for use with a library supplied ` @selectProvider ` . See the following for an example of
119
+ the mapper method used for the query coded above:
120
+
121
+ ``` java
122
+ @Mapper
123
+ public interface PersonMapper {
124
+
125
+ @SelectProvider (type = SpringBatchProviderAdapter . class, method = " select" )
126
+ @Results ({
127
+ @Result (column = " id" , property = " id" , id = true ),
128
+ @Result (column = " first_name" , property = " firstName" ),
129
+ @Result (column = " last_name" , property = " lastName" )
130
+ })
131
+ List<PersonRecord > selectMany (Map<String , Object > parameterValues );
132
+ }
133
+ ```
134
+
135
+ Note the use of the ` SpringBatchProviderAdapter ` - that adapter knows how to retrieve the rendered queries from the
136
+ parameter map initialed in the method above.
117
137
118
138
### Migrating from 1.x Support for MyBatisPagingItemReader
119
139
@@ -128,9 +148,9 @@ SelectStatementProvider selectStatement = SpringBatchUtility.selectForPaging(pe
128
148
.render();
129
149
```
130
150
131
- That utility method was very limited in capability. It only supported limit and offset based queries - which are not
132
- supported in all databases. The new method allows the full capabilities of the library. To migrate,
133
- follow these steps:
151
+ That utility method was very limited in capability and has been removed. The prior method only supported limit and
152
+ offset based queries - which are not supported in all databases. The new method described above allows the full
153
+ capabilities of the library to be used. To migrate, follow these steps:
134
154
135
155
1 . Replace ` SpringBatchUtility.selectForPaging(...) ` with ` SqlBuilder.select(...) `
136
156
2 . Add ` limit() ` , ` fetchFirst() ` , and ` offset() ` method calls as appropriate for your query and database
0 commit comments