Package 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
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
ConstructorsConstructorDescriptionMetaSchema
(Database database, int id, String schemaName, User owner) Creates a new instance of meta data schema. -
Method Summary
Modifier and TypeMethodDescriptionfindTableOrView
(SessionLocal session, String name) Try to find a table or view with this name.getAllTablesAndViews
(SessionLocal session) Get all tables and views.getMap
(SessionLocal session) Returns map of tables in this schema.getTableOrView
(SessionLocal session, String name) Get the table or view with the given name.getTableOrViewByName
(SessionLocal session, 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 Details
-
MetaSchema
Creates a new instance of meta data schema.- Parameters:
database
- the databaseid
- the object idschemaName
- the schema nameowner
- the owner of the schema
-
-
Method Details
-
findTableOrView
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 classSchema
- Parameters:
session
- the sessionname
- the object name- Returns:
- the object or null
-
getAllTablesAndViews
Description copied from class:Schema
Get all tables and views.- Overrides:
getAllTablesAndViews
in classSchema
- Parameters:
session
- the session,null
to exclude meta tables- Returns:
- a (possible empty) list of all objects
-
getTableOrView
Description copied from class:Schema
Get the table or view with the given name. Local temporary tables are also returned.- Overrides:
getTableOrView
in classSchema
- Parameters:
session
- the sessionname
- the table or view name- Returns:
- the table or view
-
getTableOrViewByName
Description copied from class:Schema
Get the table with the given name, if any.- Overrides:
getTableOrViewByName
in classSchema
- Parameters:
session
- the sessionname
- the table name- Returns:
- the table or null if not found
-
getMap
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).
-