Provides definitions for some of HSQLDB's additional system view. The views supported in this class are mainly those that are needed to build the ResultSet objects that are returned by JDBC DatabaseMetaData calls.
The definitions for the rest of SQL standard and HSQLDB specific system views are provided by DatabaseInformationFull, which extends this class.
Produces a collection of views that form the system data dictionary.
Implementations use a group of arrays of equal size to store various attributes or cached instances of system tables.
Two fixed static lists of reserved table names are kept in String[] and HsqlName[] forms. These are shared by all implementations of DatabaseInformtion.
Each implementation keeps a lookup set of names for those tables whose contents are never cached (nonCachedTablesSet).
An instance of this class uses three lists named sysTablexxxx for caching system tables.
sysTableSessionDependent indicates which tables contain data that is dependent on the user rights of the User associated with the Session.
sysTableSessions contains the Session with whose rights each cached table was built.
sysTables contains the cached tables.
At the time of instantiation, which is part of the Database.open() method invocation, an empty table is created and placed in sysTables with calls to generateTable(int) for each name in sysTableNames. Some of these table entries may be null if an implementation does not produce them.
Calls to setStore(String, Session) return a cached table if various caching rules are met (see below), or it will delete all rows of the table and rebuild the contents via generateTable(int).
generateTable(int) calls the appropriate single method for each table. These methods either build and return an empty table (if sysTables contains null for the table slot) or populate the table with up-to-date rows.
Rules for caching are applied as follows:
If a table has non-cached contents, its contents are cleared and rebuilt.
For the rest of the tables, if the table has not been built for the Session object, or it is out of date, the table contents are cleared and rebuilt.
(fredt@users)
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static Type | |
| pack-priv static Type | |
| protected static final HashSet | nonCachedTablesSet
Set: { names of system tables that are not to be cached } |
| pack-priv static Type | |
| protected static final HsqlNameManager. | sysTableHsqlNames
The HsqlNames of the system tables. |
| protected final Table[] | sysTables
cache of system tables |
| protected static final boolean[] | sysTableSessionDependent
true if the contents of a cached system table depends on the session |
| protected static final String[] | tableTypes
The table types HSQLDB supports. |
| pack-priv static Type | |
| pack-priv static Type |
| Access | Constructor and Description |
|---|---|
| pack-priv | DatabaseInformationMain(Database
the db)Database object for which this object
produces system tablesConstructs a table producer which provides system tables
for the specified |
| Modifier and Type | Method and Description |
|---|---|
| protected final void | |
| protected void | addPColRows(Session session, Table
the table in which the rows are to be inserted t, HsqlArrayList<String> the list of procedure name aliases to which the specified
column values apply l, String the procedure's catalog name cat, String the procedure's schema name schem, String the procedure's simple base (non-alias) name pName, String the procedure column name cName, Integer the column type (return, parameter, result) cType, Integer the column's data type code dType, String the column's canonical data type name tName, Integer the column's precision prec, Integer the column's buffer length len, Integer the column's scale (decimal digits) scale, Integer the column's numeric precision radix radix, Integer the column's java.sql.DatbaseMetaData nullabiliy code nullability, String a human-readable remark regarding the column remark, String String colDefault, Integer helper value to back JDBC contract sort order sqlDataType, Integer Integer sqlDateTimeSub, Integer Integer charOctetLength, Integer Integer ordinalPosition, String String isNullable, String the specific name of the procedure (typically but
not limited to a fully qualified Java Method name and signature) specificName)Inserts a set of procedure column description rows into the
|
| protected void | addProcRows(Session session, Table
the table into which the specified rows will eventually
be inserted t, HsqlArrayList<String> the list of procedure name aliases to which the specified column
values apply l, String the procedure catalog name cat, String the procedure schema name schem, String the base (non-alias) procedure name pName, Integer the procedure input parameter count ip, Integer the procedure output parameter count op, Integer the procedure result column count rs, String a human-readable remark regarding the procedure remark, Integer the procedure type code, indicating whether it is a
function, procedure, or uncatagorized (i.e. returns
a value, does not return a value, or it is unknown
if it returns a value) pType, String the specific name of the procedure
(typically but not limited to a
fully qualified Java Method name and signature) specificName, String origin of the procedure, e.g.
(["BUILTIN" | "USER DEFINED"] "ROUTINE" | "TRIGGER") | "ALIAS", etc. origin)Inserts a set of procedure description rows into the |
| protected final Iterator | Returns: an enumeration over all the tables in this databaseRetrieves an enumeration over all the tables in this database. |
| protected final Iterator | |
| protected final Long | |
| pack-priv final Table | Returns: aTable object describing the visible
access rights for all visible columns of
all accessible tables defined within this
databaseRetrieves a |
| protected final Table | Returns: a new system tableof the table nameCreates a new primoidal system table with the specified name. |
| protected Table | Returns: the system table corresponding to the specified tableIndex valueint value identifying the system table to generate tableIndex)Retrieves the system table corresponding to the specified tableIndex value. |
| public final Table | Returns: a system table corresponding to thename and
session argumentsthe Session object requesting the table session, String a String identifying the desired table
database access error occurs name)Overrides org. Retrieves the system |
| pack-priv final Table | Returns: aTable object naming the accessible
catalogs defined within this databaseRetrieves a |
| protected final void | |
| protected final Integer | |
| private boolean | Returns: true if the table is accessible, else falsethe schmea object for which to check accessibility object)Retrieves whether any form of SQL access is allowed against the specified table w.r.t the database access rights assigned to current Session object's User. |
| public boolean | |
| pack-priv final Table | Returns: TableThe SEQUENCES view has one row for each external sequence generator. |
| public final void | setStore(Session session, Table table, PersistentStore store)
Overrides org. Sets the store for the given session, populates the store if necessary. |
| pack-priv final Table | Returns: aTable object describing the optimal
set of visible columns that uniquely identifies a row
for each accessible table defined within this databaseRetrieves a |
| pack-priv final Table | Returns: aTable object describing the
visible columns of all accessible
tables defined within this database.Retrieves a |
| pack-priv final Table | Returns: Result
getClientInfoProperties |
| pack-priv final Table | Returns: aTable object describing how accessible tables
import other accessible tables' primary key and/or unique
constraint columnsRetrieves a |
| pack-priv final Table | Returns: aTable object describing the visible
Index objects for each accessible
table defined within this database.Retrieves a |
| pack-priv final Table | Returns: aTable object describing the visible
primary key columns of each accessible table
defined within this database.Retrieves a |
| pack-priv Table | Returns: aTable object describing the
return, parameter and result columns
of the accessible routines defined
within this database.Retrieves a |
| pack-priv Table | Returns: aTable object describing the accessible
routines defined within this databaseRetrieves a |
| pack-priv final Table | Returns: table containing information about schemas defined within this databaseRetrieves a |
| pack-priv final Table | |
| pack-priv final Table | Returns: aTable object describing the accessible
tables defined within this databaseRetrieves a |
| pack-priv Table | Returns: aTable object describing the table types
available in this databaseRetrieves a |
| pack-priv final Table | Returns: aTable object describing the
system-defined SQL types supported as table columnsRetrieves a |
| pack-priv Table | Returns: aTable object describing the accessible
attrubutes of the accessible user-defined type
(UDT) objects defined within this databaseRetrieves a |
| pack-priv Table | Returns: aTable object describing the accessible
user-defined types defined in this databaseRetrieves a |
| pack-priv Table | Returns: table containing information about the users defined within this databaseRetrieves a |
| pack-priv Table | Returns: aTable object describing the columns
that are automatically updated when any value
in a row is updatedRetrieves a |
| pack-priv final Table | Returns: aTable object describing the visible
access rights for each accessible table
defined within this databaseThe TABLE_PRIVILEGES view has one row for each visible access right for each accessible table defined within this database. |
| pack-priv Table |