Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
838d004c
by Tony Chemit at 2022-11-29T02:37:52+01:00
1 changed file:
Changes:
| ... | ... | @@ -188,8 +188,8 @@ public abstract class RootOpenableDtoEntityContext< |
| 188 | 188 | NativeQuery<Object[]> query = dao.getSqlQuery(definition.getCountAllQueryName(request));
|
| 189 | 189 | Stream<Object[]> stream = query.stream();
|
| 190 | 190 | List<DataGroupByValue> result = stream.map(DataGroupByValue::of).collect(Collectors.toList());
|
| 191 | - if (request.isLoadNullGroupBy()) {
|
|
| 192 | - // add null count
|
|
| 191 | + if (request.isLoadNullGroupBy() && result.stream().noneMatch(d -> d.getValue() == null)) {
|
|
| 192 | + // add null count (if not already found)
|
|
| 193 | 193 | NativeQuery<Number> nullQuery = dao.getSqlQuery(definition.getCountOneQueryName(request.getGroupByFlavor(), false));
|
| 194 | 194 | long nullCount = nullQuery.uniqueResultOptional().map(Number::longValue).orElse(0L);
|
| 195 | 195 | if (nullCount > 0) {
|