public PageIterator getPageIterator ( String sqlqueryAllCount , String sqlquery , Collection queryParams , int startIndex , int count ) { Debug . logVerbose ( "[JdonFramework]enter getPageIterator .. start= " + startIndex + " count=" + count , module ) ; if ( queryParams == null ) { Debug . logError ( " the parameters collection is null" , module ) ; return new PageIterator ( ) ; } if ( ( count > blockStrategy . getBlockLength ( ) ) || ( count <= 0 ) ) { // every count = blockStrategy . getBlockLength ( ) ; } Block currentBlock = getBlock ( sqlquery , queryParams , startIndex , count ) ; if ( currentBlock == null ) { return new PageIterator ( ) ; } startIndex = currentBlock . getStart ( ) ; int endIndex = startIndex + currentBlock . getCount ( ) ; Object [ ] keys = currentBlock . getList ( ) . toArray ( ) ; int allCount = getDatasAllCount ( queryParams , sqlqueryAllCount ) ; Debug . logVerbose ( "[JdonFramework]currentBlock: startIndex=" + startIndex + " endIndex=" + endIndex + " keys length=" + keys . length , module ) ; if ( endIndex < startIndex ) { Debug . logWarning ( "WARNNING : endIndex < startIndex" , module ) ; return new PageIterator ( ) ; } else { return new PageIterator ( allCount , keys , startIndex , endIndex , count ) ; } }
get a PageIterator