This commit is contained in:
@@ -256,11 +256,14 @@ public final class EntityCache<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Sheet<T> querySheet(final boolean needtotal, final SelectColumn selects, final Predicate<T> filter, final Flipper flipper, final Comparator<T> sort) {
|
public Sheet<T> querySheet(final boolean needtotal, final SelectColumn selects, final Predicate<T> filter, final Flipper flipper, final Comparator<T> sort) {
|
||||||
Stream<T> stream = listStream();
|
long total = 0;
|
||||||
if (filter != null) stream = stream.filter(filter);
|
if (needtotal) {
|
||||||
long total = needtotal ? stream.count() : 0;
|
Stream<T> stream = listStream();
|
||||||
|
if (filter != null) stream = stream.filter(filter);
|
||||||
|
total = stream.count();
|
||||||
|
}
|
||||||
if (needtotal && total == 0) return new Sheet<>();
|
if (needtotal && total == 0) return new Sheet<>();
|
||||||
stream = listStream();
|
Stream<T> stream = listStream();
|
||||||
if (filter != null) stream = stream.filter(filter);
|
if (filter != null) stream = stream.filter(filter);
|
||||||
if (sort != null) stream = stream.sorted(sort);
|
if (sort != null) stream = stream.sorted(sort);
|
||||||
if (flipper != null) {
|
if (flipper != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user