From 958d72dbcf582aa223255346cb8cbb66359cc8f6 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Mon, 24 Dec 2018 14:57:08 +0000 Subject: [PATCH] Fixed: Having condition is ignored on queryList() and queryFirst() calls in EntityQuery (OFBIZ-9890) queryList() and queryFirst() both call internal private query() method. This method calls delegator.findList if a normal Entity/ViewEntity is used (not a DVE). DVE has no option to include a having condition and so must opt to use queryIterator(). Even queryCount() can use a having condition. Thanks: Rupert Howell and Gareth Carter for report, Prakhar Kumar for discussion and Gareth Carter for the fix git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849693 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java index 6acf533b0b..7c6a48612b 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java @@ -447,7 +447,7 @@ public class EntityQuery { findOptions = efo; } List result = null; - if (dynamicViewEntity == null) { + if (dynamicViewEntity == null && this.havingEntityCondition == null) { result = delegator.findList(entityName, makeWhereCondition(useCache), fieldsToSelect, orderBy, findOptions, useCache); } else { try (EntityListIterator it = queryIterator()) {