org.apache.ojb.broker.accesslayer
Interface OJBIterator

All Superinterfaces:
java.util.Iterator
All Known Implementing Classes:
ChainingIterator, PagingIterator, ReportQueryRsIterator, RsIterator, SqlBasedReportQueryRsIterator, SqlBasedRsIterator

public interface OJBIterator
extends java.util.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 365232 2005-12-21 22:36:07Z tomdz $

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.



(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30