Package org.h2.schema

Class MetaSchema

All Implemented Interfaces:
HasSQL
Direct Known Subclasses:
InformationSchema, PgCatalogSchema

public abstract class MetaSchema extends Schema
Meta data schema.
  • Constructor Details

    • MetaSchema

      public MetaSchema(Database database, int id, String schemaName, User owner)
      Creates a new instance of meta data schema.
      Parameters:
      database - the database
      id - the object id
      schemaName - the schema name
      owner - the owner of the schema
  • Method Details

    • findTableOrView

      public Table findTableOrView(SessionLocal session, String name)
      Description copied from class: Schema
      Try to find a table or view with this name. This method returns null if no object with this name exists. Local temporary tables are also returned. Synonyms are not returned or resolved.
      Overrides:
      findTableOrView in class Schema
      Parameters:
      session - the session
      name - the object name
      Returns:
      the object or null
    • getAllTablesAndViews

      public Collection<Table> getAllTablesAndViews(SessionLocal session)
      Description copied from class: Schema
      Get all tables and views.
      Overrides:
      getAllTablesAndViews in class Schema
      Parameters:
      session - the session, null to exclude meta tables
      Returns:
      a (possible empty) list of all objects
    • getTableOrView

      public Table getTableOrView(SessionLocal session, String name)
      Description copied from class: Schema
      Get the table or view with the given name. Local temporary tables are also returned.
      Overrides:
      getTableOrView in class Schema
      Parameters:
      session - the session
      name - the table or view name
      Returns:
      the table or view
    • getTableOrViewByName

      public Table getTableOrViewByName(SessionLocal session, String name)
      Description copied from class: Schema
      Get the table with the given name, if any.
      Overrides:
      getTableOrViewByName in class Schema
      Parameters:
      session - the session
      name - the table name
      Returns:
      the table or null if not found
    • getMap

      protected abstract Map<String,Table> getMap(SessionLocal session)
      Returns map of tables in this schema.
      Parameters:
      session - the session
      Returns:
      map of tables in this schema
    • isEmpty

      public boolean isEmpty()
      Description copied from class: Schema
      Return whether is this schema is empty (does not contain any objects).
      Overrides:
      isEmpty in class Schema
      Returns:
      true if this schema is empty, false otherwise