public List<Forest> getForest(int limit, int offset) {
try {
return newArrayList(ao.find(Forest.class, Query.select().order("ID DESC").limit(limit).offset(offset)));
} catch (Exception e) {
return null;
}
}
上面的代码工作正常,但它不返回总行数。 所以我无法应用最后一页索引。 我申请了First,Next&amp;以前
答案 0 :(得分:1)
我想你需要&#34;计算&#34;你的记录:
Query query = Query.select().order("ID DESC");
int count = ao.count(Forest.class, query);