📄 ditableinfo.java
字号:
/** * Retrieves the remarks, if any, recorded against the specified * column. <p> * * @param i zero-based column index * @return the remarks recorded against the specified column. */ String getColRemarks(int i) { String key; if (table.getTableType() != Table.SYSTEM_TABLE) { return null; } key = getName() + "_" + getColName(i); return BundleHandler.getString(hnd_column_remarks, key); } /** * Retrieves the declared (but not currently enforced) or implicit fixed * number of digits to the right of the decimal point for exact numeric * types. * * If the column's type precludes scale declaration, null is returned. * * @param i zero-based column index * @return the fixed number of digits to the right of the decimal point * for exact numeric types. */ Integer getColScale(int i) { Column column; int type; column = table.getColumn(i); type = column.getDIType(); return Types.acceptsScaleCreateParam(type) ? ValuePool.getInt(column.getScale()) : null; } /** * Retrieves null (not implemented). <p> * * @param i zero-based column index * @return null (not implemented) */ String getColScopeCat(int i) { return null; } /** * Retrieves null (not implemented). <p> * * @param i zero-based column index * @return null (not implemented) */ String getColScopeSchem(int i) { return null; } /** * Retrieves null (not implemented). <p> * * @param i zero-based column index * @return null (not implemented) */ String getColScopeTable(int i) { return null; } /** * Retrieves either the declared or maximum length/precision for * the specified column, if its type allows a precision/length * declaration, else null. <p> * * @param i zero-based column index * @return the declared or maximum length/precision for * the specified column */ Integer getColSize(int i) { Column column; int type; int size; column = table.getColumn(i); type = column.getDIType(); if (!Types.acceptsPrecisionCreateParam(type)) { return null; } size = column.getSize(); if (size > 0) { return ValuePool.getInt(size); } else { ti.setTypeCode(type); return ti.getPrecision(); } } /** * Retrieves the SQL CLI data type code for the specified column. <p> * * @param i zero-based column index * @return the SQL CLI data type code for the specified column */ Integer getColSqlDataType(int i) { ti.setTypeCode(table.getColumn(i).getDIType()); return ti.getSqlDataType(); } /** * Retrieves the SQL CLI datetime subtype for the specified column. <p> * * @param i zero-based column index * @return the SQL CLI datetime subtype for the specified column */ Integer getColSqlDateTimeSub(int i) { ti.setTypeCode(table.getColumn(i).getDIType()); return ti.getSqlDateTimeSub(); } /** * Retrieves the full data source descriptor for [TEMP] TEXT tables. <p> * * @return the full data source descriptor */ String getDataSource() { return table.getDataSource(); } /** * Retrieves the HSQLDB-specific type of the table. <p> * * @return the HSQLDB-specific type of the table */ String getHsqlType() { switch (table.getTableType()) { case Table.MEMORY_TABLE : case Table.TEMP_TABLE : case Table.SYSTEM_TABLE : return "MEMORY"; case Table.CACHED_TABLE : return "CACHED"; case Table.TEMP_TEXT_TABLE : case Table.TEXT_TABLE : return "TEXT"; case Table.VIEW : default : return null; } } /** * Retrieves null (not implemented). <p> * * @param i zero-based index specifier * @return null (not implemented) */ Integer getIndexCardinality(int i) { return null; } /** * Retrieves the sort-direction for the specified column in the * specified index. <p> * * @param i zero-based index specifier * @param columnPosition zero-based ordinal position of column in index * @return the sort-direction for the specified column in the * specified index */ String getIndexColDirection(int i, int columnPosition) { // so far, hsqldb only supports completely ascending indexes return "A"; } /** * Retrieves an array map from the zero-based ordinal positions of the * columns in the specfied Index to the zero-based ordinal positions of * the same columns in the table. <p> * * @param i zero-based index specifier * @return an array map from the zero-based ordinal positions of * the columns in the specfied Index to the zero-based * ordinal positions of the same columns in the table */ int[] getIndexColumns(int i) { return table.getIndex(i).getColumns(); } /** * Retrieves the simple name of the specified Index. <p> * * @param i zero-based index specifier * @return the simple name of the specified Index */ String getIndexName(int i) { return table.getIndex(i).getName().name; } /** * Retrieves null (not implemented). <p> * * @param i zero-based index specifier * @return null (not implemented) */ Integer getIndexRowCardinality(int i) { return null; } /** * Retrieves the DatabaseMetaData type code of the specified Index. <p> * * @param i zero-based index specifier * @return the DatabaseMetaData type code of the specified Index */ Integer getIndexType(int i) { return ValuePool.getInt(tableIndexOther); } /** * Retrieves the number of visible columns in the specified Index. That * is, this retrieves one less than the physical number of columns if the * table maintains an internal primary index on an internal identity * column, as is the case when the table has no declared primary key or * identity column. <p> * * @param i zero-based index specifier * @return the number of visible columns in the specified Index */ int getIndexVisibleColumns(int i) { return table.getIndex(i).getVisibleColumns(); } /** * Retrieves the simple name of the table. <p> * * @return the simple name of the table */ String getName() { return table.getName().name; } /** * Retrieves the value of the next automatically assigned identity. <p> * * Be aware that this is not necessarily the value that will be assigned * to the identity column during the next insert or update. This value is * used if NULL is either implicitly or explicity assigned. <p> * * @return the value of the next automatically assigned identity */ Long getNextIdentity() { Index pi; if (table.identityColumn < 0) { return null; } return ValuePool.getLong(table.identitySequence.peek()); } /** * Retrieves the remarks (if any) recorded against the Table. <p> * * @return the remarks recorded against the Table */ String getRemark() { return (table.getTableType() == Table.SYSTEM_TABLE) ? BundleHandler.getString(hnd_table_remarks, getName()) : null; } /** * Retrieves the standard JDBC type of the table. <p> * * "TABLE" for user-defined tables, "VIEW" for user-defined views, * and so on. * * @return the standard JDBC type of the table */ String getStandardType() { switch (table.getTableType()) { case Table.VIEW : return "VIEW"; case Table.TEMP_TABLE : case Table.TEMP_TEXT_TABLE : return "GLOBAL TEMPORARY"; case Table.SYSTEM_TABLE : return "SYSTEM TABLE"; default : return "TABLE"; } } /** * Retrieves the Table object on which this object is currently * reporting. <p> * * @return the Table object on which this object * is currently reporting */ Table getTable() { return this.table; } /** * Retrieves, for [TEMP] TEXT tables, whether the table's data source * descriptor requests descending read semantics. That is, when this * value is true, it indicate that the text file is to be read from * the bottom up. <p> * * @return whether the table's data source * descriptor requests descending * read semantics */ Boolean isDataSourceDescending() { return ValuePool.getBoolean(table.isDescDataSource()); } /** * Retrieves whether the specified Index is non-unique. <p> * * @param i zero-based index specifier * @return whether the specified Index is non-unique */ Boolean isIndexNonUnique(int i) { return ValuePool.getBoolean(!table.getIndex(i).isUnique()); } /** * Retrieves whether the table is in data read-only mode. This value does * not reflect the various read-only modes of the database or the * read-only mode of the connection. <p> * * @return whether the table is in data read-only mode */ Boolean isReadOnly() { return ValuePool.getBoolean(table.isDataReadOnly()); } /** * Assigns the Table object on which this object is to report. <p> * * @param table the Table object on which this object is to report */ void setTable(Table table) { this.table = table; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -