Tuscany DAS for Relational Databases

org.apache.tuscany.das.rdb
Interface Pager

All Known Implementing Classes:
PagerImpl

public interface Pager

An iterator-like interface to conveniently move through chunks of data. The idea is that a Pager works with a read Command. The read command returns a large amount of data and the client wants to work with chunks of it at a time. So the Pager is created on the command and each call to next returns the next chunk of data. This is done completely disconnected. No cursor is maintained between calls to #next. TODO - This is very preliminary. We need to look at this interface in the context of disonnected scenarios such as a web app. The Pager instance will probably be saved in session so it must be very light and cannot reference a connection. Also, we probably need to define a factory or add a method to set page size.


Method Summary
 commonj.sdo.DataObject getPage(int page)
          Return a specific identified page.
 commonj.sdo.DataObject next()
          Get the next page of data
 commonj.sdo.DataObject previous()
          Get the page prior to the last page returned
 

Method Detail

next

commonj.sdo.DataObject next()
Get the next page of data

Returns:
the next page of data

previous

commonj.sdo.DataObject previous()
Get the page prior to the last page returned

Returns:
the previous page

getPage

commonj.sdo.DataObject getPage(int page)
Return a specific identified page.

Parameters:
page - The number of the page to return
Returns:
the indicated page

Tuscany DAS for Relational Databases

-