Class CursoredStreamPolicy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, CoreContainerPolicy<AbstractSession>

    public class CursoredStreamPolicy
    extends CursorPolicy

    Purpose: Used to support cursored streams in a read query.

    Responsibilities: Execute the cursored read and build the stream.

    Since:
    TOPLink/Java 1.2
    Author:
    James Sutherland
    See Also:
    Serialized Form
    • Field Detail

      • initialReadSize

        protected int initialReadSize
    • Constructor Detail

      • CursoredStreamPolicy

        public CursoredStreamPolicy()
        default constructor
      • CursoredStreamPolicy

        public CursoredStreamPolicy​(ReadQuery query,
                                    int pageSize)
        set the initial read size to match the page size
      • CursoredStreamPolicy

        public CursoredStreamPolicy​(ReadQuery query,
                                    int initialReadSize,
                                    int pageSize)
      • CursoredStreamPolicy

        public CursoredStreamPolicy​(ReadQuery query,
                                    int initialReadSize,
                                    int pageSize,
                                    ValueReadQuery sizeQuery)
    • Method Detail

      • execute

        public java.lang.Object execute()
        INTERNAL: Execute the cursored select and build the stream.
        Specified by:
        execute in class CursorPolicy
      • getInitialReadSize

        public int getInitialReadSize()
        Specifies the number of elements to be read initially into a cursored stream.
      • getSizeQuery

        public ValueReadQuery getSizeQuery()
        Return the query used to read the size. This is required for SQL read queries.
      • hasSizeQuery

        public boolean hasSizeQuery()
        INTERNAL: Return if a custom size query is defined.
      • remoteExecute

        public java.lang.Object remoteExecute()
        INTERNAL: Execute the cursored select and build the stream.
        Specified by:
        remoteExecute in class CursorPolicy
      • setInitialReadSize

        public void setInitialReadSize​(int initialReadSize)
        Specifies the number of elements to be read initially into a cursored stream
      • setSizeQuery

        public void setSizeQuery​(ValueReadQuery sizeQuery)
        Set the query used to read the size. This is required for SQL read queries.