Interface InformationExtractor
Contract for extracting information about objects in the database schema(s). To an extent, the contract largely
mirrors parts of the JDBC
DatabaseMetaData contract. THe intention is to insulate callers
from DatabaseMetaData since on many databases there are better ways to get information from
the meta schema.- API Note:
- Concepts here taken largely from the
MetaDataDialectclass in Hibernate Tools.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancatalogExists(Identifier catalog) Does the given catalog exist yet?getForeignKeys(Identifier catalog, Identifier schema) Extract all the foreign keys information.getForeignKeys(TableInformation tableInformation) Extract information about foreign keys defined on the given table (targeting or point-at other tables).getIndexes(Identifier catalog, Identifier schema) Extract all the indexes information.getIndexes(TableInformation tableInformation) Extract information about indexes defined against the given table.@Nullable PrimaryKeyInformationgetPrimaryKey(TableInformation tableInformation) Extract information about the given table's primary key.getPrimaryKeys(Identifier catalog, Identifier schema) Extract all the primary keys information.getTable(Identifier catalog, Identifier schema, Identifier tableName) Look for a matching table.getTables(Identifier catalog, Identifier schema) Extract all the tables information.booleanschemaExists(Identifier catalog, Identifier schema) Does the given schema exist yet?booleanCangetForeignKeys(Identifier, Identifier)be used?booleanCangetIndexes(Identifier, Identifier)be used?booleanCangetPrimaryKeys(Identifier, Identifier)be used?
-
Method Details
-
catalogExists
Does the given catalog exist yet?- Parameters:
catalog- The name of the catalog to look for.- Returns:
trueif the catalog does exist;falseotherwise
-
schemaExists
Does the given schema exist yet?- Parameters:
catalog- The name of the catalog to look in.schema- The name of the schema to look for.- Returns:
trueif the schema does exist;falseotherwise
-
getTable
Look for a matching table.- Parameters:
catalog- Can benull, indicating that any catalog may be considered a match. A non-nullvalue indicates that search should be limited to the passed catalog.schema- Can benull, indicating that any schema may be considered a match. A non-nullvalue indicates that search should be limited to the passed schema .tableName- The name of the table to look for.- Returns:
- table info for the matching table
-
getTables
Extract all the tables information.- Parameters:
catalog- Can benull, indicating that any catalog may be considered a match. A non-nullvalue indicates that search should be limited to the passed catalog.schema- Can benull, indicating that any schema may be considered a match. A non-nullvalue indicates that search should be limited to the passed schema .- Returns:
- a
NameSpaceTablesInformation
-
getPrimaryKey
Extract information about the given table's primary key.- Parameters:
tableInformation- The table for which to locate primary key information,- Returns:
- The extracted primary key information
-
getPrimaryKeys
Extract all the primary keys information.- Parameters:
catalog- Can benull, indicating that any catalog may be considered a match. A non-nullvalue indicates that search should be limited to the passed catalog.schema- Can benull, indicating that any schema may be considered a match. A non-nullvalue indicates that search should be limited to the passed schema .- Returns:
- a
NameSpacePrimaryKeysInformation - Throws:
SchemaExtractionException- when bulk extraction isn't supported- Since:
- 7.2
-
getIndexes
Extract information about indexes defined against the given table. Typically called from the TableInformation itself as part of on-demand initialization of its state.- Parameters:
tableInformation- The table for which to locate indexes- Returns:
- The extracted index information
-
getIndexes
Extract all the indexes information.- Parameters:
catalog- Can benull, indicating that any catalog may be considered a match. A non-nullvalue indicates that search should be limited to the passed catalog.schema- Can benull, indicating that any schema may be considered a match. A non-nullvalue indicates that search should be limited to the passed schema .- Returns:
- a
NameSpaceIndexesInformation - Throws:
SchemaExtractionException- when bulk extraction isn't supported- Since:
- 7.2
-
getForeignKeys
Extract information about foreign keys defined on the given table (targeting or point-at other tables). Typically called from the TableInformation itself as part of on-demand initialization of its state.- Parameters:
tableInformation- The table for which to locate foreign-keys- Returns:
- The extracted foreign-key information
-
getForeignKeys
Extract all the foreign keys information.- Parameters:
catalog- Can benull, indicating that any catalog may be considered a match. A non-nullvalue indicates that search should be limited to the passed catalog.schema- Can benull, indicating that any schema may be considered a match. A non-nullvalue indicates that search should be limited to the passed schema .- Returns:
- a
NameSpaceForeignKeysInformation - Throws:
SchemaExtractionException- when bulk extraction isn't supported- Since:
- 7.2
-
supportsBulkPrimaryKeyRetrieval
boolean supportsBulkPrimaryKeyRetrieval()CangetPrimaryKeys(Identifier, Identifier)be used?- Since:
- 7.2
-
supportsBulkForeignKeyRetrieval
boolean supportsBulkForeignKeyRetrieval()CangetForeignKeys(Identifier, Identifier)be used?- Since:
- 7.2
-
supportsBulkIndexRetrieval
-