Class AbstractJDBCDatabaseInterface.ResultSetInfo

  • Enclosing class:
    AbstractJDBCDatabaseInterface

    private static final class AbstractJDBCDatabaseInterface.ResultSetInfo
    extends java.lang.Object
    Whenever a ResultSet is generated, this object contains the result set. This class only allows calls to safe methods in Table.

    NOTE: This is safe provided, a) The column topology doesn't change (NOTE: issues with ALTER command) b) Root locking prevents modification to rows.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ColumnDescription[] col_desc
      A set of ColumnDescription that describes each column in the ResultSet.
      private int locked
      Incremented when we lock roots.
      private SQLQuery query
      The SQLQuery that was executed to produce this result.
      private Table result
      The table that is the result.
      private boolean result_is_simple_enum
      Set to true if the result table has a SimpleRowEnumeration, therefore guarenteeing we do not need to store a row lookup list.
      private int result_row_count
      The number of rows in the result.
      private IntegerVector row_index_map
      IntegerVector that contains the row index into the table for each row of the result.
      private java.util.HashMap streamable_blob_map
      A HashMap of blob_reference_id values to Ref objects used to handle and streamable objects in this result.
    • Constructor Summary

      Constructors 
      Constructor Description
      ResultSetInfo​(SQLQuery query, Table table)
      Constructs the result set.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void dispose()
      Disposes this object.
      (package private) TObject getCellContents​(int column, int row)
      Gets the cell contents of the cell at the given row/column.
      (package private) int getColumnCount()
      Returns the column count.
      (package private) ColumnDescription[] getFields()
      Returns the ColumnDescription array of all the columns in the result.
      (package private) Ref getRef​(long id)
      Returns a Ref that has been cached in this table object by its identifier value.
      (package private) int getRowCount()
      Returns the row count.
      (package private) SQLQuery getSQLQuery()
      Returns the SQLQuery that was used to produce this result.
      (package private) void lockRoot​(int key)
      Locks the root of the result set.
      (package private) void removeRef​(long id)
      Removes a Ref that has been cached in this table object by its identifier value.
      (package private) void unlockRoot​(int key)
      Unlocks the root of the result set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • query

        private SQLQuery query
        The SQLQuery that was executed to produce this result.
      • result

        private Table result
        The table that is the result.
      • col_desc

        private ColumnDescription[] col_desc
        A set of ColumnDescription that describes each column in the ResultSet.
      • row_index_map

        private IntegerVector row_index_map
        IntegerVector that contains the row index into the table for each row of the result. For example, row.intAt(5) will return the row index of 'result' of the 5th row item.
      • result_is_simple_enum

        private boolean result_is_simple_enum
        Set to true if the result table has a SimpleRowEnumeration, therefore guarenteeing we do not need to store a row lookup list.
      • result_row_count

        private int result_row_count
        The number of rows in the result.
      • locked

        private int locked
        Incremented when we lock roots.
      • streamable_blob_map

        private java.util.HashMap streamable_blob_map
        A HashMap of blob_reference_id values to Ref objects used to handle and streamable objects in this result.
    • Constructor Detail

      • ResultSetInfo

        ResultSetInfo​(SQLQuery query,
                      Table table)
        Constructs the result set.
    • Method Detail

      • getSQLQuery

        SQLQuery getSQLQuery()
        Returns the SQLQuery that was used to produce this result.
      • getRef

        Ref getRef​(long id)
        Returns a Ref that has been cached in this table object by its identifier value.
      • removeRef

        void removeRef​(long id)
        Removes a Ref that has been cached in this table object by its identifier value.
      • dispose

        void dispose()
        Disposes this object.
      • getCellContents

        TObject getCellContents​(int column,
                                int row)
        Gets the cell contents of the cell at the given row/column.

        Safe only if roots are locked.

      • getColumnCount

        int getColumnCount()
        Returns the column count.
      • getRowCount

        int getRowCount()
        Returns the row count.
      • getFields

        ColumnDescription[] getFields()
        Returns the ColumnDescription array of all the columns in the result.
      • lockRoot

        void lockRoot​(int key)
        Locks the root of the result set.
      • unlockRoot

        void unlockRoot​(int key)
        Unlocks the root of the result set.