Top Description Methods
org.hibernate.tool.schema.extract.spi

public Interface InformationExtractor

Known Direct Implementers
org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
Annotations
@Incubating
Imports
org.hibernate.Incubating, org.hibernate.boot.model.naming.Identifier, org.hibernate.tool.schema.extract.internal.TableInformationImpl

Contract for extracting information about objects in the database schema(s). To an extent, the contract largely mirrors parts of the JDBC java.sql.DatabaseMetaData contract. THe intention is to insulate callers from java.sql.DatabaseMetaData since on many databases there are better ways to get information from the meta schema.

API Note

Concepts here taken largely from the MetaDataDialect class in Hibernate Tools.

Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the catalog does exist; false otherwise
catalogExists
(Identifier
The name of the catalog to look for.
catalog
)

Does the given catalog exist yet?

public Iterable<ForeignKeyInformation>

Returns:

The extracted foreign-key information
getForeignKeys
(TableInformation
The table for which to locate foreign-keys
tableInformation
)

Extract information about foreign keys defined on the given table (targeting or point-at other tables).

public Iterable<IndexInformation>

Returns:

The extracted index information
getIndexes
(TableInformation
The table for which to locate indexes
tableInformation
)

Extract information about indexes defined against the given table.

public PrimaryKeyInformation

Returns:

The extracted primary key information
getPrimaryKey
(TableInformationImpl
The table for which to locate primary key information,
tableInformation
)

Extract information about the given table's primary key.

public TableInformation

Returns:

table info for the matching table
getTable
(Identifier
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.
catalog
,
Identifier
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 .
schema
,
Identifier
The name of the table to look for.
tableName
)

Look for a matching table.

public NameSpaceTablesInformation
getTables(Identifier
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.
catalog
,
Identifier
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 .
schema
)

Extract all the tables information.

public boolean

Returns:

true if the schema does exist; false otherwise
schemaExists
(Identifier
The name of the catalog to look in.
catalog
,
Identifier
The name of the schema to look for.
schema
)

Does the given schema exist yet?

Method Detail

catalogExistsback to summary
public boolean catalogExists(Identifier catalog)

Does the given catalog exist yet?

Parameters
catalog:Identifier

The name of the catalog to look for.

Returns:boolean

true if the catalog does exist; false otherwise

getForeignKeysback to summary
public 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:TableInformation

The table for which to locate foreign-keys

Returns:Iterable<ForeignKeyInformation>

The extracted foreign-key information

getIndexesback to summary
public 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:TableInformation

The table for which to locate indexes

Returns:Iterable<IndexInformation>

The extracted index information

getPrimaryKeyback to summary
public PrimaryKeyInformation getPrimaryKey(TableInformationImpl tableInformation)

Extract information about the given table's primary key.

Parameters
tableInformation:TableInformationImpl

The table for which to locate primary key information,

Returns:PrimaryKeyInformation

The extracted primary key information

getTableback to summary
public TableInformation getTable(Identifier catalog, Identifier schema, Identifier tableName)

Look for a matching table.

Parameters
catalog:Identifier

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:Identifier

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:Identifier

The name of the table to look for.

Returns:TableInformation

table info for the matching table

getTablesback to summary
public NameSpaceTablesInformation getTables(Identifier catalog, Identifier schema)

Extract all the tables information.

Parameters
catalog:Identifier

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:Identifier

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 .

Returns:NameSpaceTablesInformation

a NameSpaceTablesInformation

schemaExistsback to summary
public boolean schemaExists(Identifier catalog, Identifier schema)

Does the given schema exist yet?

Parameters
catalog:Identifier

The name of the catalog to look in.

schema:Identifier

The name of the schema to look for.

Returns:boolean

true if the schema does exist; false otherwise