Author: lektran
Date: Tue Sep 1 00:35:24 2009
New Revision: 809785
URL:
http://svn.apache.org/viewvc?rev=809785&view=revLog:
Fix paging bug in product search as reported by Amit Sharma
Also switched the party search result set type back to scroll insensitive
Modified:
ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java
Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=809785&r1=809784&r2=809785&view=diff==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Tue Sep 1 00:35:24 2009
@@ -1401,7 +1401,7 @@
highIndex = (viewIndex + 1) * viewSize;
// set distinct on so we only get one row per order
- EntityFindOptions findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_FORWARD_ONLY, EntityFindOptions.CONCUR_READ_ONLY, -1, highIndex, true);
+ EntityFindOptions findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, -1, highIndex, true);
// using list iterator
EntityListIterator pli = delegator.findListIteratorByCondition(dynamicView, mainCond, null, fieldsToSelect, orderBy, findOpts);
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java?rev=809785&r1=809784&r2=809785&view=diff==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java Tue Sep 1 00:35:24 2009
@@ -640,7 +640,11 @@
efo.setDistinct(true);
efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE);
if (maxResults != null) {
- efo.setMaxRows(maxResults);
+ int queryMaxResults = maxResults;
+ if (resultOffset != null) {
+ queryMaxResults += resultOffset - 1;
+ }
+ efo.setMaxRows(queryMaxResults);
}
EntityListIterator eli = null;