BATCH-848: improved the paging support

This commit is contained in:
trisberg
2008-10-21 04:28:15 +00:00
parent f840809ef2
commit c3df035607
4 changed files with 14 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ public class IbatisPagingItemReaderCommonTests extends CommonDatabaseItemStreamI
SqlMapClient sqlMapClient = createSqlMapClient();
IbatisPagingItemReader reader = new IbatisPagingItemReader();
reader.setQueryId("getAllFoos");
reader.setQueryId("getPagedFoos");
reader.setSqlMapClient(sqlMapClient);
reader.setSaveState(true);

View File

@@ -24,7 +24,7 @@ public class IbatisPagingItemReaderParameterTests extends AbstractPagingItemRead
SqlMapClient sqlMapClient = createSqlMapClient();
IbatisPagingItemReader reader = new IbatisPagingItemReader();
reader.setQueryId("getFoos3AndUp");
reader.setQueryId("getPagedFoos3AndUp");
reader.setParameterValues(Collections.<String, Object>singletonMap("limit", 3));
reader.setSqlMapClient(sqlMapClient);
reader.setSaveState(true);

View File

@@ -22,6 +22,14 @@
select ID, NAME, VALUE from T_FOOS
</select>
<select id="getPagedFoos" resultMap="fooResult">
select LIMIT #_skiprows# #_pagesize# ID, NAME, VALUE from T_FOOS order by ID
</select>
<select id="getPagedFoos3AndUp" resultMap="fooResult">
select LIMIT #_skiprows# #_pagesize# ID, NAME, VALUE from T_FOOS where VALUE >= #limit# order by ID
</select>
<select id="getFoos3AndUp" resultMap="fooResult">
select ID, NAME, VALUE from T_FOOS where VALUE >= #limit#
</select>