Class Cursor

    • Field Detail

      • statement

        protected transient Statement statement
        The preparedStatement that holds the handle to the database that the results are read from.
      • resultSet

        protected transient ResultSet resultSet
        The result set (cursor) that holds the handle to the database that the results are read from.
      • session

        protected transient AbstractSession session
        The session that executed the query for the stream.
      • executionSession

        protected transient AbstractSession executionSession
        The root session that executed the call for the query. Knows the database platform.
      • fields

        protected transient Vector<DatabaseField> fields
        The fields expected in the result set.
      • size

        protected int size
        Cached size of the stream.
      • query

        public transient ReadQuery query
        Read query that initialize the stream.
      • policy

        public transient CursorPolicy policy
        Query policy that initialize the stream.
      • objectCollection

        protected List<Object> objectCollection
        Internal collection of objects.
      • initiallyConformingIndex

        protected Map<Object,​Object> initiallyConformingIndex
        Conforming instances found in memory when building the result.
      • selectionCriteriaClone

        protected Expression selectionCriteriaClone
        SelectionCriteria & translation row ready for incremental conforming.
      • nextRow

        protected AbstractRecord nextRow
        Store the next row, for 1-m joining.
      • position

        protected int position
        Current position in the objectCollection of the stream.
    • Constructor Detail

      • Cursor

        public Cursor()
        INTERNAL: Default constructor.
    • Method Detail

      • close

        public void close()
                   throws DatabaseException
        PUBLIC: Closes the stream. This should be performed whenever the user has finished with the stream.
        Throws:
        DatabaseException
      • getAccessor

        public DatabaseAccessor getAccessor()
        INTERNAL: Return the accessor associated with the cursor.
      • getFields

        public Vector<DatabaseField> getFields()
        INTERNAL: Return the fields for the stream.
      • getInitiallyConformingIndex

        public Map<Object,​Object> getInitiallyConformingIndex()
        INTERNAL: Conforming instances found in memory when building the result. These objects are returned first by the cursor, and a fast lookup is needed to make sure the same objects appearing in the cursor are filtered out.
      • getObjectCollection

        public List<Object> getObjectCollection()
        INTERNAL: Return the internal object collection that stores the objects.
      • getPageSize

        public int getPageSize()
        INTERNAL: Return the number of items to be faulted in for the stream.
      • getPolicy

        public CursorPolicy getPolicy()
        INTERNAL: Return the cursor policy.
      • getPosition

        public abstract int getPosition()
        INTERNAL: Return the position of the stream inside the object collection.
      • getQuery

        public ReadQuery getQuery()
        INTERNAL: Return the query associated with the stream.
      • getResultSet

        public ResultSet getResultSet()
        INTERNAL: Return the result set (cursor).
      • getSelectionCriteriaClone

        public Expression getSelectionCriteriaClone()
        INTERNAL: The clone of the selection criteria is needed for in-memory conforming each object read from the Cursor.
      • getSession

        public AbstractSession getSession()
        INTERNAL: Return the handle to the session
      • getExecutionSession

        public AbstractSession getExecutionSession()
        INTERNAL: Returns the session the underlying call was executed on. This root session knows the database platform.
      • getStatement

        protected Statement getStatement()
        INTERNAL: Return the Statement.
      • getTranslationRow

        protected AbstractRecord getTranslationRow()
        INTERNAL: Gets the translation row the query was executed with, used for incremental conforming.
      • isClosed

        public boolean isClosed()
        PUBLIC: Return if the stream is closed.
      • buildAndRegisterObject

        protected Object buildAndRegisterObject​(AbstractRecord row)
        INTERNAL: builds and registers an object from a row for cursors. Behavior is different from the query version in that refreshing is not supported.
      • setFields

        protected void setFields​(Vector<DatabaseField> fields)
        INTERNAL: Set the fields for the stream.
      • setInitiallyConformingIndex

        public void setInitiallyConformingIndex​(Map<Object,​Object> index)
        INTERNAL: Conforming instances found in memory when building the result. These objects are returned first by the cursor, and a fast lookup is needed to make sure the same objects appearing in the cursor are filtered out.
      • setObjectCollection

        public void setObjectCollection​(List<Object> collection)
        INTERNAL: Set the internal object collection
      • setPolicy

        public void setPolicy​(CursorPolicy policy)
        INTERNAL: Set the cursor policy.
      • setPosition

        protected void setPosition​(int value)
        INTERNAL: Set the current position of the stream
      • setResultSet

        protected void setResultSet​(ResultSet result)
        INTERNAL: Set the result set (cursor)
      • setSelectionCriteriaClone

        public void setSelectionCriteriaClone​(Expression expression)
        INTERNAL: The clone of the selection criteria is needed for in-memory conforming each object read from the Cursor.
      • setSession

        public void setSession​(AbstractSession databaseSession)
        INTERNAL: Set the session handle
      • setExecutionSession

        protected void setExecutionSession​(AbstractSession executionSession)
        INTERNAL: Sets the session the underlying call was executed on. This root session knows the database platform.
      • setSize

        public void setSize​(int size)
        INTERNAL: Set the cache size
      • setTranslationRow

        public void setTranslationRow​(AbstractRecord row)
        INTERNAL: Sets the translation row this query was executed with. Used for incremental conforming.
      • size

        public int size()
                 throws DatabaseException
        PUBLIC: Retrieve the size of the open cursor by executing a count on the same query as the cursor. If this cursor is conforming size() can only be an estimate. cursor size plus number of conforming instances found in memory will be returned. The union (actual result) may be smaller than this.
        Throws:
        DatabaseException
      • clear

        public void clear()
        PUBLIC: Release all objects read in so far. This should be performed when reading in a large collection of objects in order to preserve memory.