Package org.h2.schema

Class MetaSchema

    • Constructor Detail

      • MetaSchema

        public MetaSchema​(Database database,
                          int id,
                          java.lang.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 Detail

      • findTableOrView

        public Table findTableOrView​(SessionLocal session,
                                     java.lang.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 java.util.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,
                                    java.lang.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,
                                          java.lang.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 java.util.Map<java.lang.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