#511 - PagedList getTotalRowCount() includes soft deleted rows in its count

This commit is contained in:
Robin Bygrave
2016-01-05 07:37:17 +13:00
parent be91e3f3f7
commit fb3e8b9fc4
2 changed files with 13 additions and 0 deletions
@@ -2,6 +2,7 @@ package com.avaje.tests.draftable;
import com.avaje.ebean.Ebean;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebean.PagedList;
import com.avaje.ebean.Query;
import com.avaje.tests.model.draftable.Link;
import org.junit.Test;
@@ -32,6 +33,15 @@ public class LinkQueryPublishTest {
ids.add(link2.getId());
ids.add(link3.getId());
PagedList<Link> pagedList =
server.find(Link.class).asDraft()
.where().idIn(ids)
.setMaxRows(10)
.findPagedList();
assertThat(pagedList.getTotalRowCount()).isEqualTo(3);
Query<Link> pubQuery = server.find(Link.class)
.where().idIn(ids)
.order().asc("id");