org.apache.ojb.broker.accesslayer
Interface OJBIterator

All Superinterfaces:
Iterator
All Known Implementing Classes:
BaseConnection.OTMIterator, ChainingIterator, PagingIterator, ReportQueryRsIterator, RsIterator, SqlBasedReportQueryRsIterator, SqlBasedRsIterator

public interface OJBIterator
extends Iterator

A Iterator extension internaly used by OJB to handle query results.

NOTE: OJB is very strict in handling OJBIterator instances. OJBIterator is bound very closely to the used PersistenceBroker instance. Thus if you do a
- PersistenceBroker.close()
- PersistenceBroker.commitTransaction()
- PersistenceBroker.abortTransaction()
call, the current OJBIterator instance resources will be cleaned up automatic and invalidate current instance.

Version:
$Id: OJBIterator.java,v 1.1 2007-08-24 22:17:30 ewestfal Exp $

Method Summary
 boolean absolute(int row)
          Moves the cursor to the given row number in the iterator.
 void disableLifeCycleEvents()
          Do not fire any PBLifeCycleEvent when reading next item.
 int fullSize()
           
 boolean relative(int row)
          Moves the cursor a relative number of rows, either positive or negative.
 void releaseDbResources()
          Release all internally used Database resources of the iterator.
 int size()
           
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

size

int size()
         throws PersistenceBrokerException
Returns:
the size of the iterator, aka the number of rows in this iterator.
Throws:
PersistenceBrokerException

fullSize

int fullSize()
             throws PersistenceBrokerException
Returns:
the unlimited size of the iterator, fullSize() may differ from size() for PagingIterator
Throws:
PersistenceBrokerException

absolute

boolean absolute(int row)
                 throws PersistenceBrokerException
Moves the cursor to the given row number in the iterator. If the row number is positive, the cursor moves to the given row number with respect to the beginning of the iterator. The first row is row 1, the second is row 2, and so on.

Parameters:
row - the row to move to in this iterator, by absolute number
Throws:
PersistenceBrokerException

relative

boolean relative(int row)
                 throws PersistenceBrokerException
Moves the cursor a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the iterator positions the cursor before/after the the first/last row. Calling relative(0) is valid, but does not change the cursor position.

Parameters:
row - the row to move to in this iterator, by relative number
Throws:
PersistenceBrokerException

releaseDbResources

void releaseDbResources()
Release all internally used Database resources of the iterator. Clients must call this methods explicitely if the iterator is not exhausted by the client application. If the Iterator is exhauseted this method will be called implicitely.


disableLifeCycleEvents

void disableLifeCycleEvents()
Do not fire any PBLifeCycleEvent when reading next item.



Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.