Interface ITable

All Superinterfaces:
IRelation, ISearchPath, IStatement, IStatementContainer
All Known Subinterfaces:
IForeignTable, IPartitionTable
All Known Implementing Classes:
ChTable, ChTableLog, GpExternalTable, GpPartitionTable, MsTable, PgAbstractForeignTable, PgAbstractRegularTable, PgAbstractTable, PgPartitionForeignTable, PgPartitionTable, PgSimpleForeignTable, PgSimpleTable, PgTypedTable

public interface ITable extends IRelation, IStatementContainer
Interface for database table
  • Method Details

    • getColumn

      IColumn getColumn(String name)
    • getStatementType

      default DbObjType getStatementType()
      Description copied from interface: IStatement
      Gets the type of this database object.
      Specified by:
      getStatementType in interface IStatement
      Returns:
      the database object type
    • getColumns

      Collection<IColumn> getColumns()
    • getConstraints

      Collection<IConstraint> getConstraints()
    • columnAdder

      static Stream<? extends IStatement> columnAdder(IStatement st)
      Creates a stream that includes the statement itself and its columns if it's a table.
      Parameters:
      st - the statement to process
      Returns:
      a stream containing the statement and its columns (if applicable)
    • appendMoveDataSql

      void appendMoveDataSql(IStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols)
      Adds commands to the script for move data from the temporary table to the new table, given the identity columns, and a command to delete the temporary table.
    • isRecreated

      boolean isRecreated(ITable newTable, ISettings settings)
      Compares this table with the newTable to determine if a full table recreation is required. A full recreation (DROP and CREATE) is needed when the tables differ in ways that cannot be altered using ALTER TABLE statements.
      Parameters:
      newTable - the new table definition to compare against
      settings - application settings that may affect the comparison logic
      Returns:
      true if the table requires recreation (DROP and CREATE) rather than being alterable, false if the changes can be applied via ALTER TABLE
    • compareIgnoringColumnOrder

      boolean compareIgnoringColumnOrder(ITable newTable)
      Parameters:
      newTable - new state of the table
      Returns:
      true if the tables are identical