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
This commit is contained in:
Jacques Le Roux
2018-12-24 14:57:08 +00:00
parent ec25a95dd4
commit 958d72dbcf
@@ -447,7 +447,7 @@ public class EntityQuery {
findOptions = efo;
}
List<GenericValue> 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()) {