| java.lang.Object org.hsqldb.SchemaManager
SchemaManager | public class SchemaManager (Code) | | Manages all SCHEMA related database objects
author: fredt@users version: 1.8.0 since: 1.8.0 |
Inner Class :public class Schema | |
Method Summary | |
public Iterator | allSequencesIterator() | public Iterator | allTablesIterator() | void | checkCascadeDropViews(View view, boolean cascade) Throws if the view is referenced in a view. | void | checkCascadeDropViews(Table table, boolean cascade) Throws if the table is referenced in a view. | void | checkCascadeDropViews(NumberSequence sequence, boolean cascade) Throws if the sequence is referenced in a view. | void | checkColumnIsInView(Table table, String column) Throws if the column is referenced in a view. | void | checkConstraintExists(String name, String schemaName, boolean yes) | void | checkIndexExists(String name, String schemaName, boolean yes) | void | checkTriggerExists(String name, String schemaName, boolean yes) Checks if a Trigger with given name either exists or does not, based on
the value of the argument, yes. | void | checkUserTableNotExists(Session session, String tableName, String schema) | void | checkUserViewNotExists(Session session, String viewName, String schema) | void | clearStructures() | void | clearTempTables(Session exclude, Table table) Clear copies of a temporary table from all sessions apart from one. | void | createSchema(String name, boolean isQuoted) | NumberSequence | createSequence(HsqlName hsqlname, long start, long increment, int type) | void | dropIndex(Session session, String indexname, String schema, boolean ifExists) Drops the index with the specified name. | void | dropSchema(String name, boolean cascade) | void | dropSequence(NumberSequence sequence) | void | dropTable(Session session, String name, String schemaName, boolean ifExists, boolean isView, boolean cascade) Drops the specified user-defined view or table from this Database
object. | void | dropTable(Table table, boolean cascade) | void | dropTrigger(Session session, String name, String schemaName) Drops a trigger with the specified name in the given context. | public NumberSequence | findSequence(String name, String schemaName) Returns the specified Sequence visible within the
context of the specified Session. | Table | findUserTable(Session session, String name, String schemaName) Returns the specified user-defined table or view visible within the
context of the specified schema. | Table | findUserTableForIndex(Session session, String name, String schemaName) Returns the table that has an index with the given name and schema. | Iterator | fullSchemaNamesIterator() | public HsqlArrayList | getAllTables() Returns an HsqlArrayList containing references to all non-system
tables and views. | HsqlName | getDefaultSchemaHsqlName() | public String | getDefaultSchemaName() | HsqlName | getSchemaHsqlName(String name) If schemaName is null, return the current schema name, else return
the HsqlName object for the schema. | String | getSchemaName(String name) | NumberSequence | getSequence(String name, String schemaName) | public Table | getTable(Session session, String name, String schema) Returns the specified user-defined table or view visible within the
context of the specified Session, or any system table of the given
name. | int | getTableIndex(Table table) Returns index of a table or view in the HsqlArrayList that
contains the table objects for this Database. | public HashMappedList | getTables(String schema) | public Table | getUserTable(Session session, String name, String schema) Returns the specified user-defined table or view visible within the
context of the specified Session. | View[] | getViewsWithSequence(NumberSequence sequence) Returns an array of views that reference a sequence. | public boolean | isSystemSchema(HsqlName schema) | void | linkTable(Table t) Registers the specified table or view with this Database. | void | logSequences(Session session, Logger logger) | void | recompileViews(Table table) After addition or removal of columns and indexes all views that
reference the table should be recompiled. | void | registerConstraintName(String name, HsqlName tableName) | void | registerIndexName(String name, HsqlName tableName) | void | registerTriggerName(String name, HsqlName tableName) | void | removeConstraintName(String name, HsqlName tableName) | void | removeConstraintNames(HsqlName tableName) | void | removeExportedKeys(Table toDrop) Removes any foreign key Constraint objects (exported keys) held by any
tables referenced by the specified table. | void | removeIndexName(String name, HsqlName tableName) | void | removeIndexNames(HsqlName tableName) | void | renameIndex(String oldName, String newName, HsqlName tableName) | void | renameSchema(String name, String newName, boolean isQuoted) | void | renameTable(Session session, Table table, String newName, boolean isQuoted) | boolean | schemaExists(String name) | Iterator | sequenceIterator(String schema) | void | setTable(int index, Table table) | public Iterator | tablesIterator(String schema) | HsqlName | toSchemaHsqlName(String name) | public Iterator | userSchemaNameIterator() |
DEFINITION_SCHEMA | final static String DEFINITION_SCHEMA(Code) | | |
INFORMATION_SCHEMA | final static String INFORMATION_SCHEMA(Code) | | |
INFORMATION_SCHEMA_HSQLNAME | static HsqlName INFORMATION_SCHEMA_HSQLNAME(Code) | | |
SYSTEM_SCHEMA_HSQLNAME | static HsqlName SYSTEM_SCHEMA_HSQLNAME(Code) | | |
defaultSchemaHsqlName | HsqlName defaultSchemaHsqlName(Code) | | |
checkCascadeDropViews | void checkCascadeDropViews(View view, boolean cascade) throws HsqlException(Code) | | Throws if the view is referenced in a view.
|
checkCascadeDropViews | void checkCascadeDropViews(Table table, boolean cascade) throws HsqlException(Code) | | Throws if the table is referenced in a view.
|
checkCascadeDropViews | void checkCascadeDropViews(NumberSequence sequence, boolean cascade) throws HsqlException(Code) | | Throws if the sequence is referenced in a view.
|
checkTriggerExists | void checkTriggerExists(String name, String schemaName, boolean yes) throws HsqlException(Code) | | Checks if a Trigger with given name either exists or does not, based on
the value of the argument, yes.
|
clearStructures | void clearStructures()(Code) | | |
clearTempTables | void clearTempTables(Session exclude, Table table)(Code) | | Clear copies of a temporary table from all sessions apart from one.
|
dropTable | void dropTable(Session session, String name, String schemaName, boolean ifExists, boolean isView, boolean cascade) throws HsqlException(Code) | | Drops the specified user-defined view or table from this Database
object.
The process of dropping a table or view includes:
- checking that the specified Session's currently connected User
has the right to perform this operation and refusing to proceed if
not by throwing.
- checking for referential constraints that conflict with this
operation and refusing to proceed if they exist by throwing.
- removing the specified Table from this Database object.
- removing any exported foreign keys Constraint objects held by
any tables referenced by the table to be dropped. This is especially
important so that the dropped Table ceases to be referenced,
eventually allowing its full garbage collection.
-
Parameters: name - of the table or view to drop Parameters: ifExists - if true and if the Table to drop does not exist, failsilently, else throw Parameters: isView - true if the name argument refers to a View Parameters: session - the connected context in which to perform thisoperation throws: HsqlException - if any of the checks listed above fail |
findUserTable | Table findUserTable(Session session, String name, String schemaName)(Code) | | Returns the specified user-defined table or view visible within the
context of the specified schema. It excludes system tables.
Returns null if the table does not exist in the context.
|
findUserTableForIndex | Table findUserTableForIndex(Session session, String name, String schemaName)(Code) | | Returns the table that has an index with the given name and schema.
|
fullSchemaNamesIterator | Iterator fullSchemaNamesIterator()(Code) | | Iterator includes INFORMATION_SCHEMA
|
getAllTables | public HsqlArrayList getAllTables()(Code) | | Returns an HsqlArrayList containing references to all non-system
tables and views. This includes all tables and views registered with
this Database.
|
getDefaultSchemaHsqlName | HsqlName getDefaultSchemaHsqlName()(Code) | | |
getDefaultSchemaName | public String getDefaultSchemaName()(Code) | | |
getSchemaHsqlName | HsqlName getSchemaHsqlName(String name) throws HsqlException(Code) | | If schemaName is null, return the current schema name, else return
the HsqlName object for the schema. If schemaName does not exist,
throw.
|
getTable | public Table getTable(Session session, String name, String schema) throws HsqlException(Code) | | Returns the specified user-defined table or view visible within the
context of the specified Session, or any system table of the given
name. It excludes any temp tables created in other Sessions.
Throws if the table does not exist in the context.
|
getTableIndex | int getTableIndex(Table table)(Code) | | Returns index of a table or view in the HsqlArrayList that
contains the table objects for this Database.
Parameters: table - the Table object the index of the specified table or view, or -1 if not found |
getUserTable | public Table getUserTable(Session session, String name, String schema) throws HsqlException(Code) | | Returns the specified user-defined table or view visible within the
context of the specified Session. It excludes system tables and
any temp tables created in different Sessions.
Throws if the table does not exist in the context.
|
getViewsWithSequence | View[] getViewsWithSequence(NumberSequence sequence)(Code) | | Returns an array of views that reference a sequence.
|
isSystemSchema | public boolean isSystemSchema(HsqlName schema)(Code) | | is a schema read-only
|
linkTable | void linkTable(Table t)(Code) | | Registers the specified table or view with this Database.
|
recompileViews | void recompileViews(Table table) throws HsqlException(Code) | | After addition or removal of columns and indexes all views that
reference the table should be recompiled.
|
removeConstraintNames | void removeConstraintNames(HsqlName tableName)(Code) | | |
removeExportedKeys | void removeExportedKeys(Table toDrop)(Code) | | Removes any foreign key Constraint objects (exported keys) held by any
tables referenced by the specified table.
This method is called as the last step of a successful call to
dropTable() in order to ensure that the dropped Table ceases to be
referenced when enforcing referential integrity.
Parameters: toDrop - The table to which other tables may be holding keys.This is a table that is in the process of being dropped. |
removeIndexNames | void removeIndexNames(HsqlName tableName)(Code) | | |
toSchemaHsqlName | HsqlName toSchemaHsqlName(String name)(Code) | | |
|
|