public interface InformationExtractor
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.
NOTE : Concepts here taken largely from the MetaDataDialect
class in Hibernate Tools.Modifier and Type | Method and Description |
---|---|
boolean |
catalogExists(Identifier catalog)
Does the given catalog exist yet?
|
Iterable<ForeignKeyInformation> |
getForeignKeys(TableInformation tableInformation)
Extract information about foreign keys defined on the given table (targeting or point-at other tables).
|
Iterable<IndexInformation> |
getIndexes(TableInformation tableInformation)
Extract information about indexes defined against the given table.
|
PrimaryKeyInformation |
getPrimaryKey(org.hibernate.tool.schema.extract.internal.TableInformationImpl tableInformation)
Extract information about the given table's primary key.
|
TableInformation |
getTable(Identifier catalog,
Identifier schema,
Identifier tableName)
Look for a matching table.
|
NameSpaceTablesInformation |
getTables(Identifier catalog,
Identifier schema)
Extract all the tables information.
|
boolean |
schemaExists(Identifier catalog,
Identifier schema)
The the given schema exist yet?
|
boolean catalogExists(Identifier catalog)
catalog
- The name of the catalog to look for.true
if the catalog does exist; false
otherwiseboolean schemaExists(Identifier catalog, Identifier schema)
catalog
- The name of the catalog to look in.schema
- The name of the schema to look for.true
if the schema does exist; false
otherwiseTableInformation getTable(Identifier catalog, Identifier schema, Identifier tableName)
catalog
- Can be null
, indicating that any catalog may be considered a match. A
non-null
value indicates that search should be limited to the passed catalog.schema
- Can be null
, indicating that any schema may be considered a match. A
non-null
value indicates that search should be limited to the passed schema .tableName
- The name of the table to look for.NameSpaceTablesInformation getTables(Identifier catalog, Identifier schema)
catalog
- Can be null
, indicating that any catalog may be considered a match. A
non-null
value indicates that search should be limited to the passed catalog.schema
- Can be null
, indicating that any schema may be considered a match. A
non-null
value indicates that search should be limited to the passed schema .NameSpaceTablesInformation
PrimaryKeyInformation getPrimaryKey(org.hibernate.tool.schema.extract.internal.TableInformationImpl tableInformation)
tableInformation
- The table for which to locate primary key information,Iterable<IndexInformation> getIndexes(TableInformation tableInformation)
tableInformation
- The table for which to locate indexesIterable<ForeignKeyInformation> getForeignKeys(TableInformation tableInformation)
tableInformation
- The table for which to locate foreign-keysCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.