AbstractDao implements CrudDao<T, ID> { public CursorPage<T> queryPage(int requestedPageSize, String cursorString) { return queryPage(null, requestedPageSize, cursorString); } protected  AbstractDao(Mapper<T, ID> mapper, Supplier<Object, Object, Object, Object> supplier); R withCommitTransaction(TransFunc<R> transFunc); R withRollbackTransaction(TransFunc<R> transFunc); R withTransaction(TransFunc<R> transFunc, boolean commit); static R withTransaction(TransFunc<R> transFunc, boolean commit, Supplier<Object, Object, Object, Object> supplier); int count(); @Override int count(Object parentKey); void delete(ID id); @Override void delete(Object parentKey, ID id); void delete(Iterable<ID> ids); T get(ID id); @Override T get(Object parentKey, ID id); @Override ID put(Object parentKey, ID id, T entity); ID put(T entity); @Override ID insert(Object parentKey, ID id, T entity); CursorPage<T> queryPage(int requestedPageSize, String cursorString); @Override CursorPage<T> queryPage(Object ancestorKey, int requestedPageSize, String cursorString); Future<T> getAsync(Object parentKey, ID id); Future<ID> putAsync(T entity); ID getId(Object key); Object getKey(ID id); Object getKey(Object parentKey, ID id); String getKind(); void setParentKey(T entity, Object parentKey); static void setPrincipalName(String name);  }
@Test public void testQueryPage() throws IOException { createQueryFixtures(); Filter filter = Filter.equalsFilter(DUserMapper.Field.DISPLAYNAME.getFieldName(), "mod7_3"); CursorPage<DUser> firstPage = userDao.queryPage(false, 5, null, null, false, null, false, null, null, filter); assertEquals(Integer.valueOf(9), firstPage.getTotalSize()); assertNotNull(firstPage.getCursorKey()); assertEquals(5, firstPage.getItems().size()); CursorPage<DUser> secondPage = userDao.queryPage(false, 5, null, null, false, null, false, null, firstPage.getCursorKey(), filter); assertNull(secondPage.getTotalSize()); assertNull(secondPage.getCursorKey()); assertEquals(4, secondPage.getItems().size()); }