distinct not needed as we don't have duplicates in the id column

This commit is contained in:
Athou
2015-02-19 12:43:40 +01:00
parent d1973922cd
commit 467d1a754d

View File

@@ -36,7 +36,7 @@ public class FeedEntryDAO extends GenericDAO<FeedEntry> {
}
public List<FeedCapacity> findFeedsExceedingCapacity(long maxCapacity, long max) {
NumberExpression<Long> count = entry.id.countDistinct();
NumberExpression<Long> count = entry.id.count();
List<Tuple> tuples = newQuery().from(entry).groupBy(entry.feed).having(count.gt(maxCapacity)).limit(max).list(entry.feed.id, count);
return tuples.stream().map(t -> new FeedCapacity(t.get(entry.feed.id), t.get(count))).collect(Collectors.toList());
}