@@ -70,8 +70,8 @@ SelectStatementProvider selectStatement = SpringBatchUtility.selectForCursor(pe
7070 .render();
7171```
7272
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:
7575
76761 . Replace ` SpringBatchUtility.selectForCursor(...) ` with ` SqlBuilder.select(...) `
77772 . Replace ` render() ` with ` render(RenderingStrategies.MYBATIS3) `
@@ -114,6 +114,26 @@ Notice the following important items:
1141142 . The query must be rendered with the ` SPRING_BATCH_PAGING_ITEM_READER_RENDERING_STRATEGY ` rendering strategy. This
115115 rendering strategy will render the query so that it will respond properly to the runtime values supplied for page size
116116 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.
117137
118138### Migrating from 1.x Support for MyBatisPagingItemReader
119139
@@ -128,9 +148,9 @@ SelectStatementProvider selectStatement = SpringBatchUtility.selectForPaging(pe
128148 .render();
129149```
130150
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:
134154
1351551 . Replace ` SpringBatchUtility.selectForPaging(...) ` with ` SqlBuilder.select(...) `
1361562 . Add ` limit() ` , ` fetchFirst() ` , and ` offset() ` method calls as appropriate for your query and database
0 commit comments