Package org.h2.table

Class DerivedTable

All Implemented Interfaces:
HasSQL

public final class DerivedTable extends QueryExpressionTable
A derived table.
  • Constructor Details

    • DerivedTable

      public DerivedTable(SessionLocal session, String name, Column[] columnTemplates, Query query, Query topQuery)
      Create a derived table out of the given query.
      Parameters:
      session - the session
      name - the view name
      columnTemplates - column templates, or null
      query - the initialized query
      topQuery - the top level query
  • Method Details

    • createIndex

      protected QueryExpressionIndex createIndex(SessionLocal session, int[] masks)
    • isQueryComparable

      public boolean isQueryComparable()
      Description copied from class: Table
      Check whether the table (or view) contains no columns that prevent index conditions to be used. For example, a view that contains the ROWNUM() pseudo-column prevents this.
      Overrides:
      isQueryComparable in class QueryExpressionTable
      Returns:
      true if the table contains no query-comparable column
    • canDrop

      public boolean canDrop()
      Description copied from class: Table
      Check if this table can be dropped.
      Specified by:
      canDrop in class Table
      Returns:
      true if it can
    • getTableType

      public TableType getTableType()
      Description copied from class: Table
      Get the table type name
      Specified by:
      getTableType in class Table
      Returns:
      the table type name
    • getTopQuery

      public Query getTopQuery()
      Specified by:
      getTopQuery in class QueryExpressionTable
    • getCreateSQL

      public String getCreateSQL()
      Description copied from class: DbObject
      Construct the CREATE ... SQL statement for this object.
      Specified by:
      getCreateSQL in class DbObject
      Returns:
      the SQL statement
    • getSQL

      public StringBuilder getSQL(StringBuilder builder, int sqlFlags)
      Description copied from interface: HasSQL
      Appends the SQL statement of this object to the specified builder.
      Specified by:
      getSQL in interface HasSQL
      Overrides:
      getSQL in class SchemaObject
      Parameters:
      builder - string builder
      sqlFlags - formatting flags
      Returns:
      the specified string builder
    • getQueryScope

      public QueryScope getQueryScope()
      Description copied from class: QueryExpressionTable
      Returns the scope of this table
      Specified by:
      getQueryScope in class QueryExpressionTable
      Returns:
      the scope of this table