You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2008/07/01 10:50:58 UTC
svn commit: r673024 -
/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java
Author: jonesde
Date: Tue Jul 1 01:50:58 2008
New Revision: 673024
URL: http://svn.apache.org/viewvc?rev=673024&view=rev
Log:
Added small convenience method to get total size of results after getting a partial list
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java?rev=673024&r1=673023&r2=673024&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java Tue Jul 1 01:50:58 2008
@@ -488,6 +488,15 @@
throw new GenericEntityException(e.getNonNestedMessage(), e.getNested());
}
}
+
+ public int getResultsSizeAfterPartialList() throws GenericEntityException {
+ if (this.last()) {
+ return this.currentIndex();
+ } else {
+ // evidently no valid rows in the ResultSet, so return 0
+ return 0;
+ }
+ }
public void add(GenericValue obj) {
throw new GeneralRuntimeException("CursorListIterator currently only supports read-only access");