mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-24 15:55:55 +00:00
#511 - PagedList getTotalRowCount() includes soft deleted rows in its count
This commit is contained in:
@@ -529,6 +529,9 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
if (detail != null) {
|
||||
copy.detail = detail.copy();
|
||||
}
|
||||
if (temporalMode == TemporalMode.DRAFT) {
|
||||
copy.temporalMode = TemporalMode.DRAFT;
|
||||
}
|
||||
|
||||
copy.firstRow = firstRow;
|
||||
copy.maxRows = maxRows;
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user