Class GTSQLTypeInfoDataSource

  • All Implemented Interfaces:
    MutableTableDataSource, TableDataSource

    public class GTSQLTypeInfoDataSource
    extends GTDataSource
    A GTDataSource that models all SQL types that are available.

    NOTE: This is not designed to be a long kept object. It must not last beyond the lifetime of a transaction.

    • Field Detail

      • database

        private DatabaseConnection database
        The DatabaseConnection object. Currently this is not used, but it may be needed in the future if user-defined SQL types are supported.
      • key_value_pairs

        private java.util.ArrayList key_value_pairs
        The list of info keys/values in this object.
      • TYPE_NULLABLE

        private static final BigNumber TYPE_NULLABLE
        Constant for type_nullable types.
      • DEF_DATA_TABLE_DEF

        static final DataTableDef DEF_DATA_TABLE_DEF
        The data table def that describes this table of data source.
    • Constructor Detail

      • GTSQLTypeInfoDataSource

        public GTSQLTypeInfoDataSource​(DatabaseConnection connection)
        Constructor.
    • Method Detail

      • addType

        private void addType​(java.lang.String name,
                             int type,
                             int precision,
                             java.lang.String prefix,
                             java.lang.String suffix,
                             java.lang.String oops,
                             boolean searchable)
        Adds a type description.
      • getRowCount

        public int getRowCount()
        Description copied from interface: TableDataSource
        Returns the number of rows in this data source.

        NOTE: Returns 'n' - getCellContents(column, row) is not necessarily valid for row = [0..n]. Use 'rowEnumerator' to generate an iterator for valid row values over this data source.

        Specified by:
        getRowCount in interface TableDataSource
        Specified by:
        getRowCount in class GTDataSource
      • getCellContents

        public TObject getCellContents​(int column,
                                       int row)
        Description copied from interface: TableDataSource
        Returns an object that represents the information in the given cell in the table. This may be an expensive operation, so calls to it should be kept to a minimum. Note that the offset between two rows is not necessarily 1. Use 'rowEnumeration' to create a row iterator.
        Specified by:
        getCellContents in interface TableDataSource
        Specified by:
        getCellContents in class GTDataSource
      • dispose

        public void dispose()
        Description copied from interface: MutableTableDataSource
        Disposes this table data source. After this method is called, most use of this object is undefined, except for the 'getCellContent' and 'compareCellContent' methods which are valid provided the source is under a root lock.
        Specified by:
        dispose in interface MutableTableDataSource
        Overrides:
        dispose in class GTDataSource