Interface InformationExtractor
-
public interface InformationExtractorContract for extracting information about objects in the database schema(s). To an extent, the contract largely mirrors parts of the JDBCDatabaseMetaDatacontract. THe intention is to insulate callers fromDatabaseMetaDatasince on many databases there are better ways to get information from the meta schema. NOTE : Concepts here taken largely from theMetaDataDialectclass in Hibernate Tools.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancatalogExists(Identifier catalog)Does the given catalog exist yet?java.lang.Iterable<ForeignKeyInformation>getForeignKeys(TableInformation tableInformation)Extract information about foreign keys defined on the given table (targeting or point-at other tables).java.lang.Iterable<IndexInformation>getIndexes(TableInformation tableInformation)Extract information about indexes defined against the given table.PrimaryKeyInformationgetPrimaryKey(org.hibernate.tool.schema.extract.internal.TableInformationImpl tableInformation)Extract information about the given table's primary key.TableInformationgetTable(Identifier catalog, Identifier schema, Identifier tableName)Look for a matching table.NameSpaceTablesInformationgetTables(Identifier catalog, Identifier schema)Extract all the tables information.booleanschemaExists(Identifier catalog, Identifier schema)The the given schema exist yet?
-
-
-
Method Detail
-
catalogExists
boolean catalogExists(Identifier catalog)
Does the given catalog exist yet?- Parameters:
catalog- The name of the catalog to look for.- Returns:
trueif the catalog does exist;falseotherwise
-
schemaExists
boolean schemaExists(Identifier catalog, Identifier schema)
The 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
TableInformation getTable(Identifier catalog, Identifier schema, Identifier tableName)
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
NameSpaceTablesInformation getTables(Identifier catalog, Identifier schema)
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
PrimaryKeyInformation getPrimaryKey(org.hibernate.tool.schema.extract.internal.TableInformationImpl tableInformation)
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
-
getIndexes
java.lang.Iterable<IndexInformation> getIndexes(TableInformation tableInformation)
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
-
getForeignKeys
java.lang.Iterable<ForeignKeyInformation> getForeignKeys(TableInformation tableInformation)
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
-
-