Author: mbrohl
Date: Sat Sep 19 12:46:48 2015
New Revision: 1704005
URL: http://svn.apache.org/viewvc?rev=1704005&view=rev
Log:
Applied patch for OFBIZ-6526: ordermgr/control/searchorders findOrders service
returns incorrect orderCount and therefore viewSize.
This patch replaces the HashSet with LinkedHashSet for fieldsToSelect because
otherwise statusId was being added to the front of the set which was then
passed to count distinct query causing incorrect counts. LinkedHashSet
preserves the order in which items are added so orderId always appears at the
front of the set for the count distinct query.
Thanks Christian Carlow for spotting this and providing the patch.
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java?rev=1704005&r1=1704004&r2=1704005&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
(original)
+++
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
Sat Sep 19 12:46:48 2015
@@ -21,6 +21,7 @@ package org.ofbiz.order.order;
import java.math.BigDecimal;
import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
@@ -78,7 +79,7 @@ public class OrderLookupServices {
}
// list of fields to select (initial list)
- Set<String> fieldsToSelect = new HashSet<String>();
+ Set<String> fieldsToSelect = new LinkedHashSet<String>();
fieldsToSelect.add("orderId");
fieldsToSelect.add("orderName");
fieldsToSelect.add("statusId");