I'm not sure where this fits into a larger process or what intention is, but 
there is a more efficient way that involves minimal data coming back from the 
database when you only need a count and don't need and of the data. For that 
see the GenericDelegator.findCountByAnd or findCountByCondition methods.

-David


Rodrigo Souza wrote:
Hi community!

This is a my implementation to best performance in pagination using
org.ofbiz.entity.util.EntityListIterator class.

Add this method to get size of resultset without create GenericValue.

* public int getSize()throws GenericEntityException {*
*        int result = 0;*
*        try{*
*               if( resultSet.last() )*
*                   result = resultSet.getRow();*

*        }  catch (SQLException e) {*
*              Debug.logWarning("Warning: No calculate EntityListIterator
size because of exception: " + e.toString(), module);*
*        }*

*        return result;*
*    }*

Reply via email to