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
-
public final class DatabaseMetaLocal extends DatabaseMetaLocalBase
Local implementation of database meta information.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DatabaseMetaLocal(SessionLocal session)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddCrossReferenceResult(SimpleResult result, Value catalog, java.lang.String pkSchema, Table pkTable, java.lang.String fkSchema, Table fkTable, ConstraintReferential fk)private voidaddPrivilege(SimpleResult result, Value catalogValue, Value schemaValue, Value tableValue, Value granteeValue, java.lang.String right, boolean isAdmin, CompareLike columnLike, Column[] columns)private voidaddPrivileges(SimpleResult result, Value catalogValue, java.lang.String schemaName, java.lang.String tableName, DbObject grantee, int rightMask, CompareLike columnLike, Column[] columns)private booleancheckCatalogName(java.lang.String catalog)(package private) voidcheckClosed()private booleancheckSchema(java.lang.String schemaName, Schema schema)DefaultNullOrderingdefaultNullOrdering()INTERNALResultInterfacegetBestRowIdentifier(java.lang.String catalog, java.lang.String schema, java.lang.String table, int scope, boolean nullable)INTERNALResultInterfacegetCatalogs()INTERNALResultInterfacegetColumnPrivileges(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String columnNamePattern)INTERNALResultInterfacegetColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern)INTERNALprivate voidgetColumnsAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, CompareLike columnLike)ResultInterfacegetCrossReference(java.lang.String primaryCatalog, java.lang.String primarySchema, java.lang.String primaryTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable)INTERNALprivate ValuegetDataTypeName(TypeInfo typeInfo)ResultInterfacegetExportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)INTERNALprivate java.lang.StringgetFunctions(java.lang.String section)ResultInterfacegetImportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)INTERNALResultInterfacegetIndexInfo(java.lang.String catalog, java.lang.String schema, java.lang.String table, boolean unique, boolean approximate)INTERNALprivate voidgetIndexInfo(Value catalogValue, Value schemaValue, Table table, boolean unique, boolean approximate, SimpleResult result, Database db)private CompareLikegetLike(java.lang.String pattern)java.lang.StringgetNumericFunctions()INTERNALResultInterfacegetPrimaryKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)INTERNALprivate voidgetProcedureColumnAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value procedureNameValue, Value specificNameValue, TypeInfo type, boolean notNull, int ordinal)ResultInterfacegetProcedureColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern, java.lang.String columnNamePattern)INTERNALResultInterfacegetProcedures(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern)INTERNALprivate voidgetProceduresAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value procedureNameValue, java.lang.String comment, ValueSmallint procedureType, Value specificNameValue)ResultInterfacegetPseudoColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern)INTERNALprivate voidgetPseudoColumnsAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, CompareLike columnLike, Column c)private voidgetPseudoColumnsAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, CompareLike columnLike)private static ValuegetRadix(int valueType, boolean small)private static ValueSmallintgetRefAction(ConstraintActionType action)ResultInterfacegetSchemas()INTERNALprivate java.util.Collection<Schema>getSchemas(java.lang.String schema)ResultInterfacegetSchemas(java.lang.String catalog, java.lang.String schemaPattern)INTERNALprivate java.util.Collection<Schema>getSchemasForPattern(java.lang.String schemaPattern)java.lang.StringgetSearchStringEscape()INTERNALjava.lang.StringgetSQLKeywords()INTERNAL(package private) ValuegetString(java.lang.String string)java.lang.StringgetStringFunctions()INTERNALjava.lang.StringgetSystemFunctions()INTERNALResultInterfacegetTablePrivileges(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern)INTERNALResultInterfacegetTables(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String[] types)INTERNALprivate voidgetTablesAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, boolean synonym, java.util.HashSet<java.lang.String> typesSet)private java.util.Collection<? extends SchemaObject>getTablesForPattern(Schema schema, java.lang.String tablePattern)ResultInterfacegetTableTypes()INTERNALjava.lang.StringgetTimeDateFunctions()INTERNALResultInterfacegetTypeInfo()INTERNALprivate SimpleResultinitCrossReferenceResult()-
Methods inherited from class org.h2.jdbc.meta.DatabaseMetaLocalBase
getAttributes, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductVersion, getFunctionColumns, getFunctions, getPseudoColumnsResult, getSuperTables, getSuperTypes, getUDTs, getVersionColumns
-
-
-
-
Field Detail
-
YES
private static final Value YES
-
NO
private static final Value NO
-
BEST_ROW_SESSION
private static final ValueSmallint BEST_ROW_SESSION
-
BEST_ROW_NOT_PSEUDO
private static final ValueSmallint BEST_ROW_NOT_PSEUDO
-
COLUMN_NO_NULLS
private static final ValueInteger COLUMN_NO_NULLS
-
COLUMN_NO_NULLS_SMALL
private static final ValueSmallint COLUMN_NO_NULLS_SMALL
-
COLUMN_NULLABLE
private static final ValueInteger COLUMN_NULLABLE
-
COLUMN_NULLABLE_UNKNOWN_SMALL
private static final ValueSmallint COLUMN_NULLABLE_UNKNOWN_SMALL
-
IMPORTED_KEY_CASCADE
private static final ValueSmallint IMPORTED_KEY_CASCADE
-
IMPORTED_KEY_RESTRICT
private static final ValueSmallint IMPORTED_KEY_RESTRICT
-
IMPORTED_KEY_DEFAULT
private static final ValueSmallint IMPORTED_KEY_DEFAULT
-
IMPORTED_KEY_SET_NULL
private static final ValueSmallint IMPORTED_KEY_SET_NULL
-
IMPORTED_KEY_NOT_DEFERRABLE
private static final ValueSmallint IMPORTED_KEY_NOT_DEFERRABLE
-
PROCEDURE_COLUMN_IN
private static final ValueSmallint PROCEDURE_COLUMN_IN
-
PROCEDURE_COLUMN_RETURN
private static final ValueSmallint PROCEDURE_COLUMN_RETURN
-
PROCEDURE_NO_RESULT
private static final ValueSmallint PROCEDURE_NO_RESULT
-
PROCEDURE_RETURNS_RESULT
private static final ValueSmallint PROCEDURE_RETURNS_RESULT
-
TABLE_INDEX_HASHED
private static final ValueSmallint TABLE_INDEX_HASHED
-
TABLE_INDEX_OTHER
private static final ValueSmallint TABLE_INDEX_OTHER
-
TABLE_TYPES
private static final java.lang.String[] TABLE_TYPES
-
TYPE_NULLABLE
private static final ValueSmallint TYPE_NULLABLE
-
TYPE_SEARCHABLE
private static final ValueSmallint TYPE_SEARCHABLE
-
NO_USAGE_RESTRICTIONS
private static final Value NO_USAGE_RESTRICTIONS
-
session
private final SessionLocal session
-
-
Constructor Detail
-
DatabaseMetaLocal
public DatabaseMetaLocal(SessionLocal session)
-
-
Method Detail
-
defaultNullOrdering
public final DefaultNullOrdering defaultNullOrdering()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
defaultNullOrderingin classDatabaseMeta- Returns:
- DefaultNullOrdering
- See Also:
DatabaseMetaData.nullsAreSortedHigh(),DatabaseMetaData.nullsAreSortedLow(),DatabaseMetaData.nullsAreSortedAtStart(),DatabaseMetaData.nullsAreSortedAtEnd()
-
getSQLKeywords
public java.lang.String getSQLKeywords()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getSQLKeywordsin classDatabaseMeta- Returns:
- list of supported SQL keywords
- See Also:
DatabaseMetaData.getSQLKeywords()
-
getNumericFunctions
public java.lang.String getNumericFunctions()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getNumericFunctionsin classDatabaseMeta- Returns:
- list of supported numeric functions
- See Also:
DatabaseMetaData.getNumericFunctions()
-
getStringFunctions
public java.lang.String getStringFunctions()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getStringFunctionsin classDatabaseMeta- Returns:
- list of supported string functions
- See Also:
DatabaseMetaData.getStringFunctions()
-
getSystemFunctions
public java.lang.String getSystemFunctions()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getSystemFunctionsin classDatabaseMeta- Returns:
- list of supported system functions
- See Also:
DatabaseMetaData.getSystemFunctions()
-
getTimeDateFunctions
public java.lang.String getTimeDateFunctions()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getTimeDateFunctionsin classDatabaseMeta- Returns:
- list of supported time/date functions
- See Also:
DatabaseMetaData.getTimeDateFunctions()
-
getFunctions
private java.lang.String getFunctions(java.lang.String section)
-
getSearchStringEscape
public java.lang.String getSearchStringEscape()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getSearchStringEscapein classDatabaseMeta- Returns:
- search string escape sequence
- See Also:
DatabaseMetaData.getSearchStringEscape()
-
getProcedures
public ResultInterface getProcedures(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getProceduresin classDatabaseMeta- Parameters:
catalog- to inspectschemaPattern- "LIKE" style pattern to filter resultprocedureNamePattern- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getProcedures(String, String, String)
-
getProceduresAdd
private void getProceduresAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value procedureNameValue, java.lang.String comment, ValueSmallint procedureType, Value specificNameValue)
-
getProcedureColumns
public ResultInterface getProcedureColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern, java.lang.String columnNamePattern)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getProcedureColumnsin 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:
DatabaseMetaData.getProcedureColumns(String, String, String, String)
-
getProcedureColumnAdd
private void getProcedureColumnAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value procedureNameValue, Value specificNameValue, TypeInfo type, boolean notNull, int ordinal)
-
getTables
public ResultInterface getTables(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String[] types)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getTablesin classDatabaseMeta- Parameters:
catalog- to inspectschemaPattern- "LIKE" style pattern to filter resulttableNamePattern- "LIKE" style pattern to filter resulttypes- String[]- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getTables(String, String, String, String[])
-
getTablesAdd
private void getTablesAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, boolean synonym, java.util.HashSet<java.lang.String> typesSet)
-
getSchemas
public ResultInterface getSchemas()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getSchemasin classDatabaseMeta- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getSchemas()
-
getCatalogs
public ResultInterface getCatalogs()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getCatalogsin classDatabaseMeta- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getCatalogs()
-
getTableTypes
public ResultInterface getTableTypes()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getTableTypesin classDatabaseMeta- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getTableTypes()
-
getColumns
public ResultInterface getColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getColumnsin 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:
DatabaseMetaData.getColumns(String, String, String, String)
-
getColumnsAdd
private void getColumnsAdd(SimpleResult result, Value catalogValue, Value schemaValue, Value tableName, Table t, CompareLike columnLike)
-
getColumnPrivileges
public ResultInterface getColumnPrivileges(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String columnNamePattern)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getColumnPrivilegesin classDatabaseMeta- Parameters:
catalog- to inspectschema- to inspecttable- to inspectcolumnNamePattern- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getColumnPrivileges(String, String, String, String)
-
getTablePrivileges
public ResultInterface getTablePrivileges(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getTablePrivilegesin classDatabaseMeta- Parameters:
catalog- to inspectschemaPattern- "LIKE" style pattern to filter resulttableNamePattern- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getTablePrivileges(String, String, String)
-
addPrivileges
private void addPrivileges(SimpleResult result, Value catalogValue, java.lang.String schemaName, java.lang.String tableName, DbObject grantee, int rightMask, CompareLike columnLike, Column[] columns)
-
addPrivilege
private void addPrivilege(SimpleResult result, Value catalogValue, Value schemaValue, Value tableValue, Value granteeValue, java.lang.String right, boolean isAdmin, CompareLike columnLike, Column[] columns)
-
getBestRowIdentifier
public ResultInterface getBestRowIdentifier(java.lang.String catalog, java.lang.String schema, java.lang.String table, int scope, boolean nullable)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getBestRowIdentifierin 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:
DatabaseMetaData.getBestRowIdentifier(String, String, String, int, boolean)
-
getPrimaryKeys
public ResultInterface getPrimaryKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getPrimaryKeysin classDatabaseMeta- Parameters:
catalog- to inspectschema- to inspecttable- to inspect- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getPrimaryKeys(String, String, String)
-
getImportedKeys
public ResultInterface getImportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getImportedKeysin classDatabaseMeta- Parameters:
catalog- to inspectschema- to inspecttable- to inspect- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getImportedKeys(String, String, String)
-
getExportedKeys
public ResultInterface getExportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getExportedKeysin classDatabaseMeta- Parameters:
catalog- to inspectschema- to inspecttable- to inspect- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getExportedKeys(String, String, String)
-
getCrossReference
public ResultInterface getCrossReference(java.lang.String primaryCatalog, java.lang.String primarySchema, java.lang.String primaryTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getCrossReferencein classDatabaseMeta- Parameters:
primaryCatalog- to inspectprimarySchema- to inspectprimaryTable- to inspectforeignCatalog- to inspectforeignSchema- to inspectforeignTable- to inspect- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getCrossReference(String, String, String, String, String, String)
-
initCrossReferenceResult
private SimpleResult initCrossReferenceResult()
-
addCrossReferenceResult
private void addCrossReferenceResult(SimpleResult result, Value catalog, java.lang.String pkSchema, Table pkTable, java.lang.String fkSchema, Table fkTable, ConstraintReferential fk)
-
getRefAction
private static ValueSmallint getRefAction(ConstraintActionType action)
-
getTypeInfo
public ResultInterface getTypeInfo()
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getTypeInfoin classDatabaseMeta- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getTypeInfo()
-
getRadix
private static Value getRadix(int valueType, boolean small)
-
getIndexInfo
public ResultInterface getIndexInfo(java.lang.String catalog, java.lang.String schema, java.lang.String table, boolean unique, boolean approximate)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getIndexInfoin classDatabaseMeta- Parameters:
catalog- to inspectschema- to inspecttable- to inspectunique- onlyapproximate- allowed- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getIndexInfo(String, String, String, boolean, boolean)
-
getIndexInfo
private void getIndexInfo(Value catalogValue, Value schemaValue, Table table, boolean unique, boolean approximate, SimpleResult result, Database db)
-
getSchemas
public ResultInterface getSchemas(java.lang.String catalog, java.lang.String schemaPattern)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getSchemasin classDatabaseMeta- Parameters:
catalog- to inspectschemaPattern- "LIKE" style pattern to filter result- Returns:
- ResultInterface
- See Also:
DatabaseMetaData.getSchemas(String, String)
-
getPseudoColumns
public ResultInterface getPseudoColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern)
Description copied from class:DatabaseMetaINTERNAL- Specified by:
getPseudoColumnsin 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:
DatabaseMetaData.getPseudoColumns(String, String, String, String)
-
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:
checkClosedin classDatabaseMetaLocalBase
-
getString
Value getString(java.lang.String string)
-
checkCatalogName
private boolean checkCatalogName(java.lang.String catalog)
-
getSchemas
private java.util.Collection<Schema> getSchemas(java.lang.String schema)
-
getSchemasForPattern
private java.util.Collection<Schema> getSchemasForPattern(java.lang.String schemaPattern)
-
getTablesForPattern
private java.util.Collection<? extends SchemaObject> getTablesForPattern(Schema schema, java.lang.String tablePattern)
-
checkSchema
private boolean checkSchema(java.lang.String schemaName, Schema schema)
-
getLike
private CompareLike getLike(java.lang.String pattern)
-
-