EclipseLink 1.0_1.0M2 API Reference - Incubation

org.eclipse.persistence.queries
Class CursorPolicy

java.lang.Object
  extended by ContainerPolicy
      extended by org.eclipse.persistence.queries.CursorPolicy
Direct Known Subclasses:
CursoredStreamPolicy, ScrollableCursorPolicy

public abstract class CursorPolicy
extends ContainerPolicy

Purpose: Abstract class for all Cursor-related policy objects


Field Summary
protected  int pageSize
           
protected  ReadQuery query
           
 
Constructor Summary
CursorPolicy()
          INTERNAL: default constructor
CursorPolicy(ReadQuery query, int pageSize)
          INTERNAL:
 
Method Summary
 ContainerPolicy clone(ReadQuery query)
          INTERNAL:
abstract  java.lang.Object execute()
          INTERNAL: Execute the cursored select and build the stream.
 int getPageSize()
          Return the number of elements to be read into a cursored stream when more elements are needed from the database.
 ReadQuery getQuery()
          INTERNAL: Return the query.
 boolean hasNext(java.lang.Object iterator)
          INTERNAL: Return whether the iterator has more objects.
 boolean isCursorPolicy()
           
 java.lang.Object iteratorFor(java.lang.Object container)
          INTERNAL: Return an iterator for the given container.
protected  java.lang.Object next(java.lang.Object iterator)
          INTERNAL: Return the next object on the queue.
 boolean overridesRead()
          INTERNAL: This can be used by collection such as cursored stream to gain control over execution.
 void prepare(DatabaseQuery query, AbstractSession session)
          INTERNAL: Prepare and validate.
abstract  java.lang.Object remoteExecute()
          INTERNAL: Execute the cursored select and build the stream.
 void setPageSize(int pageSize)
          Set the number of elements to be read into a cursored stream when more elements are needed from the database.
 void setQuery(ReadQuery query)
          INTERNAL: Set the query.
 int sizeFor(java.lang.Object container)
          INTERNAL: Return the size of container.
protected  java.lang.Object toStringInfo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageSize

protected int pageSize

query

protected ReadQuery query
Constructor Detail

CursorPolicy

public CursorPolicy()
INTERNAL: default constructor


CursorPolicy

public CursorPolicy(ReadQuery query,
                    int pageSize)
INTERNAL:

Method Detail

clone

public ContainerPolicy clone(ReadQuery query)
INTERNAL:


execute

public abstract java.lang.Object execute()
INTERNAL: Execute the cursored select and build the stream.


getPageSize

public int getPageSize()
Return the number of elements to be read into a cursored stream when more elements are needed from the database.


getQuery

public ReadQuery getQuery()
INTERNAL: Return the query.


hasNext

public boolean hasNext(java.lang.Object iterator)
INTERNAL: Return whether the iterator has more objects.

Parameters:
iterator - java.lang.Object
Returns:
boolean true if iterator has more objects

isCursorPolicy

public boolean isCursorPolicy()

iteratorFor

public java.lang.Object iteratorFor(java.lang.Object container)
INTERNAL: Return an iterator for the given container. This iterator can then be used as a parameter to #hasNext() and #next().

See Also:
ContainerPolicy#hasNext(java.lang.Object), ContainerPolicy#next(java.lang.Object)

next

protected java.lang.Object next(java.lang.Object iterator)
INTERNAL: Return the next object on the queue. The iterator is the one returned from #iteratorFor().

See Also:
ContainerPolicy#iteratorFor(java.lang.Object)

overridesRead

public boolean overridesRead()
INTERNAL: This can be used by collection such as cursored stream to gain control over execution.


prepare

public void prepare(DatabaseQuery query,
                    AbstractSession session)
             throws QueryException
INTERNAL: Prepare and validate.

Throws:
QueryException

remoteExecute

public abstract java.lang.Object remoteExecute()
INTERNAL: Execute the cursored select and build the stream.


setPageSize

public void setPageSize(int pageSize)
Set the number of elements to be read into a cursored stream when more elements are needed from the database.


setQuery

public void setQuery(ReadQuery query)
INTERNAL: Set the query.


sizeFor

public int sizeFor(java.lang.Object container)
INTERNAL: Return the size of container.


toStringInfo

protected java.lang.Object toStringInfo()

EclipseLink 1.0_1.0M2 API Reference - Incubation