如何获取jira活动对象分页中的最后一个偏移量?

时间:2015-08-25 11:48:54

标签: jira jira-plugin

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;以前

1 个答案:

答案 0 :(得分:1)

我想你需要&#34;计算&#34;你的记录:

Query query = Query.select().order("ID DESC");
int count = ao.count(Forest.class, query);