PagingList页面在ebean中返回错误的行数

时间:2013-05-17 15:13:54

标签: java jpa playframework-2.0 ebean

我正在使用PagingList从表中生成RawSql

我有两个实体TableEntryTableEntryAvg。后者在第一个表上执行GROUP BY以将行平均在一起。

我的电话看起来像:

Query query = Ebean.find(TableEntryAvg.class);

String sql = "SELECT MIN(id) as id,"
   +" AVG(count) as count, AVG(tof) as tof, AVG(ext) as ext," 
   +" AVG(ratio_gfp) as ratio_gfp, AVG(ratio_tof) as ratio_tof, AVG(ratio_ext) as ratio_ext, COUNT(rep) as rep, "
   +"strain, clone_id, plate_id, exp"
   +" FROM table_entry GROUP BY strain, clone_id, exp, plate_id";

RawSql rawSql = RawSqlBuilder.parse(sql)
                  .columnMapping("clone_id", "clone_id")
                  .columnMapping("strain", "strain")
                  .columnMapping("plate_id", "plate_id")
                  .columnMapping("exp", "exp");

PagingList pl = query
                .setRawSql(rawSql)
                .findPagingList(pageSize);

现在调用pl.getTotalRowCount()给我的值为40,这是不正确的。前端的表显示我有55行:

以下是前端分页的一些截图。我的页面大小为20,因此有3页。

第1页

Page 1

第2页

Page 2

第3页

Page 3

任何可能导致此问题的想法?

如果我错过了任何有用的重要信息,请告诉我,很难将其全部纳入问题。

由于

0 个答案:

没有答案
相关问题