Top Inners Fields Constructors Methods
org.hibernate.tool.schema.extract.internal

public abstract Class AbstractInformationExtractorImpl

extends Object
implements InformationExtractor
Class Inheritance
All Implemented Interfaces
org.hibernate.tool.schema.extract.spi.InformationExtractor
Known Direct Subclasses
org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl
Imports
java.sql.DatabaseMetaData, .ResultSet, .ResultSetMetaData, .SQLException, java.util.ArrayList, .Collections, .HashMap, .List, .Locale, .Map, .Objects, .StringTokenizer, org.hibernate.JDBCException, org.hibernate.boot.model.TruthValue, org.hibernate.boot.model.naming.DatabaseIdentifier, .Identifier, org.hibernate.boot.model.relational.QualifiedTableName, org.hibernate.cfg.AvailableSettings, org.hibernate.dialect.DB2Dialect, .Dialect, org.hibernate.engine.config.spi.ConfigurationService, .StandardConverters, org.hibernate.engine.jdbc.env.spi.IdentifierHelper, .JdbcEnvironment, .NameQualifierSupport, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.internal.util.StringHelper, org.hibernate.internal.util.config.ConfigurationHelper, org.hibernate.tool.schema.extract.spi.ColumnInformation, .ExtractionContext, .ForeignKeyInformation, .IndexInformation, .InformationExtractor, .NameSpaceTablesInformation, .PrimaryKeyInformation, .SchemaExtractionException, .TableInformation, org.hibernate.tool.schema.spi.SchemaManagementException

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static interface
protected static class

Field Summary

Modifier and TypeField and Description
private Identifier
private String
private Identifier
private String
private final ExtractionContext
private String[]
private static final CoreMessageLogger
private final String[]
private final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addColumns(TableInformation tableInformation)

protected void
public boolean
catalogExists(Identifier
The name of the catalog to look for.
catalog
)

Implements org.hibernate.tool.schema.extract.spi.InformationExtractor.catalogExists.

Does the given catalog exist yet?
protected JDBCException
convertSQLException(SQLException sqlException, String message)

protected String
protected String
private NameSpaceTablesInformation
private PrimaryKeyInformation
private QualifiedTableName
private TableInformation
private TableInformation
extractTableInformation(Identifier catalog, Identifier schema, Identifier tableName, ResultSet resultSet)

private QualifiedTableName
private AbstractInformationExtractorImpl.ForeignKeyBuilder
private Identifier
private String
private Identifier
private String
protected ExtractionContext
public Iterable<ForeignKeyInformation>
getForeignKeys(TableInformation
The table for which to locate foreign-keys
tableInformation
)

Implements org.hibernate.tool.schema.extract.spi.InformationExtractor.getForeignKeys.

Extract information about foreign keys defined on the given table (targeting or point-at other tables).
public Iterable<IndexInformation>
getIndexes(TableInformation
The table for which to locate indexes
tableInformation
)

Implements org.hibernate.tool.schema.extract.spi.InformationExtractor.getIndexes.

Extract information about indexes defined against the given table.
public PrimaryKeyInformation
getPrimaryKey(TableInformationImpl
The table for which to locate primary key information,
tableInformation
)

Implements org.hibernate.tool.schema.extract.spi.InformationExtractor.getPrimaryKey.

Extract information about the given table's primary key.
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected abstract String
protected String
public TableInformation
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
)

Implements org.hibernate.tool.schema.extract.spi.InformationExtractor.getTable.

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
)

Implements org.hibernate.tool.schema.extract.spi.InformationExtractor.getTables.

Extract all the tables information.
protected IdentifierHelper
protected TruthValue
interpretNullable(int nullable)

private TruthValue
protected boolean
private TableInformation
private void
protected abstract <
- defined by processor
T
>
T

Returns:

- defined by processor
processCatalogsResultSet
(ExtractionContext.ResultSetProcessor<T>
- the provided ResultSetProcessor.
processor
)

Must do the following:

  1. obtain a ResultSet containing a column of existing catalog names. The column label must be the same as returned by getResultSetCatalogLabel.
  2. execute processor.process( resultSet );
  3. release resources whether processor.process( resultSet ) executes successfully or not.
protected abstract <
- defined by processor
T
>
T

Returns:

- defined by processor
processColumnsResultSet
(String
– a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
catalog
,
String
– a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search
schemaPattern
,
String
– a table name pattern; must match the table name as it is stored in the database
tableNamePattern
,
String
– a column name pattern; must match the column name as it is stored in the database
columnNamePattern
,
ExtractionContext.ResultSetProcessor<T>
- the provided ResultSetProcessor.
processor
)

Must do the following:

  1. obtain a ResultSet containing a row for any existing catalog/schema/table/column combination as specified by the catalog, schemaPattern, tableNamePattern, and columnNamePattern parameters described below. The ResultSet must contain the following, consistent with the corresponding columns returned by DatabaseMetaData#getColumns
protected abstract <
- defined by processor
T
>
T

Returns:

- defined by processor
processImportedKeysResultSet
(String
– a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
catalog
,
String
– a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search
schema
,
String
– a table name; must match the table name as it is stored in the database
table
,
ExtractionContext.ResultSetProcessor<T>
- the provided ResultSetProcessor.
processor
)

Must do the following:

  1. obtain a ResultSet containing a row for each foreign key/ primary key column making up a foreign key for any existing catalog/schema/table combination as specified by the catalog, schema, and table parameters described below. The ResultSet must contain the following, consistent with the corresponding columns returned by DatabaseMetaData#getImportedKeys:
protected abstract <
- defined by processor
T
>
T

Returns:

- defined by processor
processIndexInfoResultSet
(String
– a catalog name; must match the catalog name as it is stored in this database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
catalog
,
String
– a schema name; must match the schema name as it is stored in this database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search
schema
,
String
– a table name; must match the table name as it is stored in this database
table
,
boolean
– when true, return only indices for unique values; when false, return indices regardless of whether unique or not
unique
,
boolean
– when true, result is allowed to reflect approximate or out of data values; when false, results are requested to be accurate
approximate
,
ExtractionContext.ResultSetProcessor<T>
- the provided ResultSetProcessor.
processor
)

Must do the following:

  1. obtain a ResultSet containing a row for each column defined in an index. The ResultSet must contain the following, consistent with the corresponding columns returned by DatabaseMetaData#getIndexInfo(String, String, String, boolean, boolean)
protected abstract <T> T
processPrimaryKeysResultSet(String catalogFilter, String schemaFilter, Identifier tableName, ExtractionContext.ResultSetProcessor<T> processor)

protected abstract <
- defined by processor
T
>
T

Returns:

- defined by processor
processSchemaResultSet
(String
– a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means catalog name should not be used to narrow down the search.
catalog
,
String
– a schema name; must match the schema name as it is stored in the database; null means schema name should not be used to narrow down the search.
schemaPattern
,
ExtractionContext.ResultSetProcessor<T>
- the provided ResultSetProcessor.
processor
)

Must do the following:

  1. obtain a ResultSet containing a row for any existing catalog/schema combination as specified by the catalog and schemaPattern parameters described below. The row contents will not be examined by processor.process( resultSet ), so column label names are not specified;
  2. execute processor.process( resultSet );
  3. release resources whether processor.process( resultSet ) executes successfully or not.
protected abstract <
- defined by processor
T
>
T

Returns:

- defined by processor
processTableResultSet
(String
- a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
catalog
,
String
- a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search
schemaPattern
,
String
- a table name pattern; must match the table name as it is stored in the database
tableNamePattern
,
String[]
- a list of table types
types
,
ExtractionContext.ResultSetProcessor<T>
- the provided ResultSetProcessor.
processor
)

Must do the following:

  1. obtain a ResultSet containing a row for any existing catalog/schema/table/table type combination as specified by the catalogFilter, schemaFilter, tableNameFilter, and tableTypes parameters described below. The ResultSet must contain the following, consistent with the corresponding columns returned by DatabaseMetaData#getTables(String, String, String, String[])
public boolean
schemaExists(Identifier
The name of the catalog to look in.
catalog
,
Identifier
The name of the schema to look for.
schema
)

Implements org.hibernate.tool.schema.extract.spi.InformationExtractor.schemaExists.

Does the given schema exist yet?
protected String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait