org.h2.schema

## Class MetaSchema

- java.lang.Object
- - org.h2.engine.DbObject
  - - org.h2.schema.Schema
    - - org.h2.schema.MetaSchema

All Implemented Interfaces:
  HasSQL

Direct Known Subclasses:
  InformationSchema, PgCatalogSchema

    public abstract class MetaSchema
    extends Schema

Meta data schema.

### Field Summary

### Fields inherited from class org.h2.engine.DbObject

`AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER`

### Fields inherited from interface org.h2.util.HasSQL

`ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS`

### Constructor Summary

Constructors
Constructor and Description
`MetaSchema(Database database, int id, java.lang.String schemaName, User owner)` Creates a new instance of meta data schema.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`Table` `findTableOrView(SessionLocal session, java.lang.String name)` Try to find a table or view with this name.
`java.util.Collection<Table>` `getAllTablesAndViews(SessionLocal session)` Get all tables and views.
`protected abstract java.util.Map<java.lang.String,Table>` `getMap(SessionLocal session)` Returns map of tables in this schema.
`Table` `getTableOrView(SessionLocal session, java.lang.String name)` Get the table or view with the given name.
`Table` `getTableOrViewByName(SessionLocal session, java.lang.String name)` Get the table with the given name, if any.
`boolean` `isEmpty()` Return whether is this schema is empty (does not contain any objects).

### Methods inherited from class org.h2.schema.Schema

`add, canDrop, createSynonym, createTable, createTableLink, findAggregate, findConstant, findConstraint, findDomain, findFunction, findFunctionOrAggregate, findIndex, findSequence, findTrigger, freeUniqueName, getAll, getAll, getAllConstants, getAllConstraints, getAllDomains, getAllFunctionsAndAggregates, getAllIndexes, getAllSequences, getAllSynonyms, getAllTriggers, getChildren, getConstant, getConstraint, getCreateSQL, getCreateSQLForCopy, getDomain, getIndex, getOwner, getSequence, getSynonym, getTableEngineParams, getType, getUniqueConstraintName, getUniqueDomainConstraintName, getUniqueIndexName, remove, removeChildrenAndResources, rename, reserveUniqueName, resolveTableOrView, setTableEngineParams`

### Methods inherited from class org.h2.engine.DbObject

`checkRename, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, getSQL, getSQL, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.h2.util.HasSQL

`getTraceSQL`

### 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