📄 databaseinformation.java
字号:
/* Copyright (c) 2001-2005, The HSQL Development Group * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the HSQL Development Group nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG, * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */package org.hsqldb;import java.lang.reflect.Constructor;import org.hsqldb.lib.IntValueHashMap;// fredt@users - 1.7.2 - structural modifications to allow inheritance// boucherB@users 20020305 - completed inheritance work, including final access// boucherB@users 20020305 - javadoc updates/corrections// boucherB@users 20020305 - SYSTEM_VIEWS brought in line with SQL 200n// boucherb@users 20050514 - further SQL 200n metdata support/** * Base class for system tables. Includes a factory method which returns the * most complete implementation available in the jar. This base implementation * knows the names of all system tables but returns null for any system table. * <p> * This class has been developed from scratch to replace the previous * DatabaseInformation implementations. <p> * * @author boucherb@users * @version 1.8.0 * @since 1.7.2 */class DatabaseInformation { // ids for system table names strictly in order of sysTableNames[] protected static final int SYSTEM_BESTROWIDENTIFIER = 0; protected static final int SYSTEM_CATALOGS = 1; protected static final int SYSTEM_COLUMNPRIVILEGES = 2; protected static final int SYSTEM_COLUMNS = 3; protected static final int SYSTEM_CROSSREFERENCE = 4; protected static final int SYSTEM_INDEXINFO = 5; protected static final int SYSTEM_PRIMARYKEYS = 6; protected static final int SYSTEM_PROCEDURECOLUMNS = 7; protected static final int SYSTEM_PROCEDURES = 8; protected static final int SYSTEM_SCHEMAS = 9; protected static final int SYSTEM_SUPERTABLES = 10; protected static final int SYSTEM_SUPERTYPES = 11; protected static final int SYSTEM_TABLEPRIVILEGES = 12; protected static final int SYSTEM_TABLES = 13; protected static final int SYSTEM_TABLETYPES = 14; protected static final int SYSTEM_TYPEINFO = 15; protected static final int SYSTEM_UDTATTRIBUTES = 16; protected static final int SYSTEM_UDTS = 17; protected static final int SYSTEM_USERS = 18; protected static final int SYSTEM_VERSIONCOLUMNS = 19; // HSQLDB-specific protected static final int SYSTEM_ALIASES = 20; protected static final int SYSTEM_BYTECODE = 21; protected static final int SYSTEM_CACHEINFO = 22; protected static final int SYSTEM_CLASSPRIVILEGES = 23; protected static final int SYSTEM_SESSIONINFO = 24; protected static final int SYSTEM_PROPERTIES = 25; protected static final int SYSTEM_SESSIONS = 26; protected static final int SYSTEM_TRIGGERCOLUMNS = 27; protected static final int SYSTEM_TRIGGERS = 28; protected static final int SYSTEM_ALLTYPEINFO = 29;// boucherb@users 20030305 - brought in line with SQL 200n protected static final int SYSTEM_VIEWS = 30;// boucherb@users 20030403 - isolated and improved text table reporting protected static final int SYSTEM_TEXTTABLES = 31;// boucherb@users 20040107 - metadata support for sequences protected static final int SYSTEM_SEQUENCES = 32; protected static final int SYSTEM_USAGE_PRIVILEGES = 33;// boucherb@users 20040107 - metadata support for constraints protected static final int SYSTEM_CHECK_CONSTRAINTS = 34; protected static final int SYSTEM_TABLE_CONSTRAINTS = 35;// boucherb@users 20040107 - metadata support for view usage breakdown- SQL 200n protected static final int SYSTEM_CHECK_COLUMN_USAGE = 36; protected static final int SYSTEM_CHECK_ROUTINE_USAGE = 37; protected static final int SYSTEM_CHECK_TABLE_USAGE = 38; protected static final int SYSTEM_VIEW_COLUMN_USAGE = 39; protected static final int SYSTEM_VIEW_TABLE_USAGE = 40; protected static final int SYSTEM_VIEW_ROUTINE_USAGE = 41;// boucherb@users 20050514 - further SQL 200n metdata support protected static final int SYSTEM_AUTHORIZATIONS = 42; protected static final int SYSTEM_COLLATIONS = 43; protected static final int SYSTEM_ROLE_AUTHORIZATION_DESCRIPTORS = 44; protected static final int SYSTEM_SCHEMATA = 45; /** system table names strictly in order of their ids */ protected static final String[] sysTableNames = { "SYSTEM_BESTROWIDENTIFIER", // "SYSTEM_CATALOGS", // "SYSTEM_COLUMNPRIVILEGES", // "SYSTEM_COLUMNS", // "SYSTEM_CROSSREFERENCE", // "SYSTEM_INDEXINFO", // "SYSTEM_PRIMARYKEYS", // "SYSTEM_PROCEDURECOLUMNS", // "SYSTEM_PROCEDURES", // "SYSTEM_SCHEMAS", // "SYSTEM_SUPERTABLES", // "SYSTEM_SUPERTYPES", // "SYSTEM_TABLEPRIVILEGES", // "SYSTEM_TABLES", // "SYSTEM_TABLETYPES", // "SYSTEM_TYPEINFO", // "SYSTEM_UDTATTRIBUTES", // "SYSTEM_UDTS", // "SYSTEM_USERS", // "SYSTEM_VERSIONCOLUMNS", // // HSQLDB-specific "SYSTEM_ALIASES", // "SYSTEM_BYTECODE", // "SYSTEM_CACHEINFO", // "SYSTEM_CLASSPRIVILEGES", // "SYSTEM_SESSIONINFO", // "SYSTEM_PROPERTIES", // "SYSTEM_SESSIONS", // "SYSTEM_TRIGGERCOLUMNS", // "SYSTEM_TRIGGERS", // "SYSTEM_ALLTYPEINFO", // // boucherb@users 20030305 - brought in line with SQL 200n "SYSTEM_VIEWS", // boucherb@users 20030403 - isolated and improved text table reporting "SYSTEM_TEXTTABLES", // boucherb@users 20040107 - metadata support for sequences - SQL 200n "SYSTEM_SEQUENCES", // "SYSTEM_USAGE_PRIVILEGES", // boucherb@users 20040107 - metadata support for constraints - SQL 200n "SYSTEM_CHECK_CONSTRAINTS", // "SYSTEM_TABLE_CONSTRAINTS", // // boucherb@users 20040107 - metadata support for usage - SQL 200n "SYSTEM_CHECK_COLUMN_USAGE", // "SYSTEM_CHECK_ROUTINE_USAGE", // "SYSTEM_CHECK_TABLE_USAGE", // "SYSTEM_VIEW_COLUMN_USAGE", // "SYSTEM_VIEW_TABLE_USAGE", // "SYSTEM_VIEW_ROUTINE_USAGE", // // boucherb@users 20050514 - further SQL 200n metadata support "SYSTEM_AUTHORIZATIONS", // "SYSTEM_COLLATIONS", // "SYSTEM_ROLE_AUTHORIZATION_DESCRIPTORS", // "SYSTEM_SCHEMATA" // // Future use// "SYSTEM_ASSERTIONS",// "SYSTEM_ATTRIBUTES",// "SYSTEM_AUTHORIZATIONS", // boucherb@users 20050514 - implemented// "SYSTEM_CHARACTER_ENCODING_FORMS",// "SYSTEM_CHARACTER_REPERTOIRES",// "SYSTEM_CHARACTER_SETS",// "SYSTEM_CHECK_COLUMN_USAGE", // boucherb@users 20040107 - implemented// "SYSTEM_CHECK_ROUTINE_USAGE", // boucherb@users 20040107 - implemented// "SYSTEM_CHECK_CONSTRAINTS", // boucherb@users 20040107 - implemented// "SYSTEM_CHECK_TABLE_USAGE", // boucherb@users 20040107 - implemented// "SYSTEM_COLLATION_CHARACTER_SET_APPLICABILITY",// "SYSTEM_COLLATIONS", // boucherb@users 20050514 - implemented// "SYSTEM_COLUMN_COLUMN_USAGE",// "SYSTEM_COLUMN_OPTIONS",// "SYSTEM_COLUMN_PRIVILEGES",// "SYSTEM_COLUMNS",// "SYSTEM_DATA_TYPE_DESCRIPTOR",// "SYSTEM_DIRECT_SUPERTABLES",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -