Package org.h2.jdbc.meta
Class DatabaseMetaLocal
java.lang.Object
org.h2.jdbc.meta.DatabaseMeta
org.h2.jdbc.meta.DatabaseMetaLocalBase
org.h2.jdbc.meta.DatabaseMetaLocal
Local implementation of database meta information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ValueSmallint
private static final ValueSmallint
private static final ValueInteger
private static final ValueSmallint
private static final ValueInteger
private static final ValueSmallint
private static final ValueSmallint
private static final ValueSmallint
private static final ValueSmallint
private static final ValueSmallint
private static final ValueSmallint
private static final Value
private static final Value
private static final ValueSmallint
private static final ValueSmallint
private static final ValueSmallint
private static final ValueSmallint
private final SessionLocal
private static final ValueSmallint
private static final ValueSmallint
private static final String[]
private static final ValueSmallint
private static final ValueSmallint
private static final Value
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addCrossReferenceResult
(SimpleResult result, Value catalog, String pkSchema, Table pkTable, String fkSchema, Table fkTable, ConstraintReferential fk) private void
addPrivilege
(SimpleResult result, Value catalogValue, Value schemaValue, Value tableValue, Value granteeValue, String right, boolean isAdmin, CompareLike columnLike, Column[] columns) private void
addPrivileges
(SimpleResult result, Value catalogValue, String schemaName, String tableName, DbObject grantee, int rightMask, CompareLike columnLike, Column[] columns) private boolean
checkCatalogName
(String catalog) (package private) void
private boolean
checkSchema
(String schemaName, Schema schema) final DefaultNullOrdering
INTERNALgetBestRowIdentifier
(String catalog, String schema, String table, int scope, boolean nullable) INTERNALINTERNALgetColumnPrivileges
(String catalog, String schema, String table, String columnNamePattern) INTERNALgetColumns
(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) INTERNALprivate void
getColumnsAdd
(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, CompareLike columnLike) getCrossReference
(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) INTERNALprivate Value
getDataTypeName
(TypeInfo typeInfo) getExportedKeys
(String catalog, String schema, String table) INTERNALprivate String
getFunctions
(String section) getImportedKeys
(String catalog, String schema, String table) INTERNALgetIndexInfo
(String catalog, String schema, String table, boolean unique, boolean approximate) INTERNALprivate void
getIndexInfo
(Value catalogValue, Value schemaValue, Table table, boolean unique, boolean approximate, SimpleResult result, Database db) private CompareLike
INTERNALgetPrimaryKeys
(String catalog, String schema, String table) INTERNALprivate void
getProcedureColumnAdd
(SimpleResult result, Value catalogValue, Value schemaValue, Value procedureNameValue, Value specificNameValue, TypeInfo type, boolean notNull, int ordinal) getProcedureColumns
(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) INTERNALgetProcedures
(String catalog, String schemaPattern, String procedureNamePattern) INTERNALprivate void
getProceduresAdd
(SimpleResult result, Value catalogValue, Value schemaValue, Value procedureNameValue, String comment, ValueSmallint procedureType, Value specificNameValue) getPseudoColumns
(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) INTERNALprivate void
getPseudoColumnsAdd
(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, CompareLike columnLike, Column c) private void
getPseudoColumnsAdd
(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, CompareLike columnLike) private static Value
getRadix
(int valueType, boolean small) private static ValueSmallint
getRefAction
(ConstraintActionType action) INTERNALprivate Collection
<Schema> getSchemas
(String schema) getSchemas
(String catalog, String schemaPattern) INTERNALprivate Collection
<Schema> getSchemasForPattern
(String schemaPattern) INTERNALINTERNAL(package private) Value
INTERNALINTERNALgetTablePrivileges
(String catalog, String schemaPattern, String tableNamePattern) INTERNALINTERNALprivate void
getTablesAdd
(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, boolean synonym, HashSet<String> typesSet) private Collection
<? extends SchemaObject> getTablesForPattern
(Schema schema, String tablePattern) INTERNALINTERNALINTERNALprivate SimpleResult
Methods inherited from class org.h2.jdbc.meta.DatabaseMetaLocalBase
getAttributes, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductVersion, getFunctionColumns, getFunctions, getPseudoColumnsResult, getSuperTables, getSuperTypes, getUDTs, getVersionColumns
-
Field Details
-
YES
-
NO
-
BEST_ROW_SESSION
-
BEST_ROW_NOT_PSEUDO
-
COLUMN_NO_NULLS
-
COLUMN_NO_NULLS_SMALL
-
COLUMN_NULLABLE
-
COLUMN_NULLABLE_UNKNOWN_SMALL
-
IMPORTED_KEY_CASCADE
-
IMPORTED_KEY_RESTRICT
-
IMPORTED_KEY_DEFAULT
-
IMPORTED_KEY_SET_NULL
-
IMPORTED_KEY_NOT_DEFERRABLE
-
PROCEDURE_COLUMN_IN
-
PROCEDURE_COLUMN_RETURN
-
PROCEDURE_NO_RESULT
-
PROCEDURE_RETURNS_RESULT
-
TABLE_INDEX_HASHED
-
TABLE_INDEX_OTHER
-
TABLE_TYPES
-
TYPE_NULLABLE
-
TYPE_SEARCHABLE
-
NO_USAGE_RESTRICTIONS
-
session
-
-
Constructor Details
-
DatabaseMetaLocal
-
-
Method Details
-
defaultNullOrdering
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
defaultNullOrdering
in classDatabaseMeta
- Returns:
- DefaultNullOrdering
- See Also:
-
getSQLKeywords
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getSQLKeywords
in classDatabaseMeta
- Returns:
- list of supported SQL keywords
- See Also:
-
getNumericFunctions
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getNumericFunctions
in classDatabaseMeta
- Returns:
- list of supported numeric functions
- See Also:
-
getStringFunctions
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getStringFunctions
in classDatabaseMeta
- Returns:
- list of supported string functions
- See Also:
-
getSystemFunctions
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getSystemFunctions
in classDatabaseMeta
- Returns:
- list of supported system functions
- See Also:
-
getTimeDateFunctions
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getTimeDateFunctions
in classDatabaseMeta
- Returns:
- list of supported time/date functions
- See Also:
-
getFunctions
-
getSearchStringEscape
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getSearchStringEscape
in classDatabaseMeta
- Returns:
- search string escape sequence
- See Also:
-
getProcedures
public ResultInterface getProcedures(String catalog, String schemaPattern, String procedureNamePattern) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getProcedures
in classDatabaseMeta
- Parameters:
catalog
- to inspectschemaPattern
- "LIKE" style pattern to filter resultprocedureNamePattern
- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
-
getProceduresAdd
private void getProceduresAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value procedureNameValue, String comment, ValueSmallint procedureType, Value specificNameValue) -
getProcedureColumns
public ResultInterface getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getProcedureColumns
in classDatabaseMeta
- Parameters:
catalog
- to inspectschemaPattern
- "LIKE" style pattern to filter resultprocedureNamePattern
- "LIKE" style pattern to filter resultcolumnNamePattern
- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
-
getProcedureColumnAdd
-
getTables
public ResultInterface getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getTables
in classDatabaseMeta
- Parameters:
catalog
- to inspectschemaPattern
- "LIKE" style pattern to filter resulttableNamePattern
- "LIKE" style pattern to filter resulttypes
- String[]- Returns:
- ResultInterface
- See Also:
-
getTablesAdd
-
getSchemas
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getSchemas
in classDatabaseMeta
- Returns:
- ResultInterface
- See Also:
-
getCatalogs
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getCatalogs
in classDatabaseMeta
- Returns:
- ResultInterface
- See Also:
-
getTableTypes
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getTableTypes
in classDatabaseMeta
- Returns:
- ResultInterface
- See Also:
-
getColumns
public ResultInterface getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getColumns
in classDatabaseMeta
- Parameters:
catalog
- to inspectschemaPattern
- "LIKE" style pattern to filter resulttableNamePattern
- "LIKE" style pattern to filter resultcolumnNamePattern
- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
-
getColumnsAdd
private void getColumnsAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, CompareLike columnLike) -
getColumnPrivileges
public ResultInterface getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getColumnPrivileges
in classDatabaseMeta
- Parameters:
catalog
- to inspectschema
- to inspecttable
- to inspectcolumnNamePattern
- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
-
getTablePrivileges
public ResultInterface getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getTablePrivileges
in classDatabaseMeta
- Parameters:
catalog
- to inspectschemaPattern
- "LIKE" style pattern to filter resulttableNamePattern
- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
-
addPrivileges
private void addPrivileges(SimpleResult result, Value catalogValue, String schemaName, String tableName, DbObject grantee, int rightMask, CompareLike columnLike, Column[] columns) -
addPrivilege
private void addPrivilege(SimpleResult result, Value catalogValue, Value schemaValue, Value tableValue, Value granteeValue, String right, boolean isAdmin, CompareLike columnLike, Column[] columns) -
getBestRowIdentifier
public ResultInterface getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getBestRowIdentifier
in classDatabaseMeta
- Parameters:
catalog
- "LIKE" style pattern to filter resultschema
- "LIKE" style pattern to filter resulttable
- table of interestscope
- of interestnullable
- include nullable columns- Returns:
- ResultInterface
- See Also:
-
getDataTypeName
-
getPrimaryKeys
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getPrimaryKeys
in classDatabaseMeta
- Parameters:
catalog
- to inspectschema
- to inspecttable
- to inspect- Returns:
- ResultInterface
- See Also:
-
getImportedKeys
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getImportedKeys
in classDatabaseMeta
- Parameters:
catalog
- to inspectschema
- to inspecttable
- to inspect- Returns:
- ResultInterface
- See Also:
-
getExportedKeys
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getExportedKeys
in classDatabaseMeta
- Parameters:
catalog
- to inspectschema
- to inspecttable
- to inspect- Returns:
- ResultInterface
- See Also:
-
getCrossReference
public ResultInterface getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getCrossReference
in classDatabaseMeta
- Parameters:
primaryCatalog
- to inspectprimarySchema
- to inspectprimaryTable
- to inspectforeignCatalog
- to inspectforeignSchema
- to inspectforeignTable
- to inspect- Returns:
- ResultInterface
- See Also:
-
initCrossReferenceResult
-
addCrossReferenceResult
private void addCrossReferenceResult(SimpleResult result, Value catalog, String pkSchema, Table pkTable, String fkSchema, Table fkTable, ConstraintReferential fk) -
getRefAction
-
getTypeInfo
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getTypeInfo
in classDatabaseMeta
- Returns:
- ResultInterface
- See Also:
-
getRadix
-
getIndexInfo
public ResultInterface getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getIndexInfo
in classDatabaseMeta
- Parameters:
catalog
- to inspectschema
- to inspecttable
- to inspectunique
- onlyapproximate
- allowed- Returns:
- ResultInterface
- See Also:
-
getIndexInfo
private void getIndexInfo(Value catalogValue, Value schemaValue, Table table, boolean unique, boolean approximate, SimpleResult result, Database db) -
getSchemas
Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getSchemas
in classDatabaseMeta
- Parameters:
catalog
- to inspectschemaPattern
- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
-
getPseudoColumns
public ResultInterface getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) Description copied from class:DatabaseMeta
INTERNAL- Specified by:
getPseudoColumns
in classDatabaseMeta
- Parameters:
catalog
- to inspectschemaPattern
- "LIKE" style pattern to filter resulttableNamePattern
- "LIKE" style pattern to filter resultcolumnNamePattern
- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
-
getPseudoColumnsAdd
private void getPseudoColumnsAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, CompareLike columnLike) -
getPseudoColumnsAdd
private void getPseudoColumnsAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, CompareLike columnLike, Column c) -
checkClosed
void checkClosed()- Specified by:
checkClosed
in classDatabaseMetaLocalBase
-
getString
-
checkCatalogName
-
getSchemas
-
getSchemasForPattern
-
getTablesForPattern
-
checkSchema
-
getLike
-