You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by br...@apache.org on 2003/12/18 19:54:32 UTC

cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer PagingIterator.java

brj         2003/12/18 10:54:32

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        PagingIterator.java
  Log:
  fixed relative()
  
  Revision  Changes    Path
  1.8       +4 -4      db-ojb/src/java/org/apache/ojb/broker/accesslayer/PagingIterator.java
  
  Index: PagingIterator.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/PagingIterator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PagingIterator.java	17 Dec 2003 20:37:02 -0000	1.7
  +++ PagingIterator.java	18 Dec 2003 18:54:32 -0000	1.8
  @@ -65,7 +65,7 @@
       private int m_endAt;
       private int m_rowLimit;
       private int m_fullSize;
  -    private int m_currentCursorPosition;
  +    private int m_currentCursorPosition; // position of the wrapped iterator
   
       /**
        * Constructor 
  @@ -141,7 +141,7 @@
   	 */
       public boolean absolute(int row) throws PersistenceBrokerException
       {
  -        int newPosition = m_startAt - 1 + row;
  +        int newPosition = (m_startAt - 1) + row;
           
           if (newPosition < m_startAt)
           {
  @@ -164,7 +164,7 @@
   	 */
       public boolean relative(int row) throws PersistenceBrokerException
       {
  -        return absolute(m_currentCursorPosition + row);
  +        return absolute(m_currentCursorPosition - (m_startAt - 1) + row);
       }
   
       /*
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org