Class AbstractReactiveInformationSchemaBasedExtractorImpl
- java.lang.Object
-
- org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
- org.hibernate.reactive.provider.service.AbstractReactiveInformationSchemaBasedExtractorImpl
-
- All Implemented Interfaces:
InformationExtractor
- Direct Known Subclasses:
MySqlReactiveInformationExtractorImpl,OracleSqlReactiveInformationExtractorImpl,PostgreSqlReactiveInformationExtractorImpl,SqlServerReactiveInformationExtractorImpl
public abstract class AbstractReactiveInformationSchemaBasedExtractorImpl extends AbstractInformationExtractorImpl
An implementation ofInformationExtractorthat obtains metadata information from a database's information_schema.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
AbstractInformationExtractorImpl.ForeignKeyBuilder, AbstractInformationExtractorImpl.ForeignKeyBuilderImpl
-
-
Constructor Summary
Constructors Constructor Description AbstractReactiveInformationSchemaBasedExtractorImpl(ExtractionContext extractionContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddExtractedColumnInformation(TableInformation tableInformation, ResultSet resultSet)protected booleanappendClauseAndParameterIfNotNullOrEmpty(String clause, Object parameter, StringBuilder sb, List<Object> parameters)protected intdataTypeCode(String typeName)Return a JDBC Type code for the given type nameprotected StringgetDatabaseCatalogColumnName(String catalogColumnName, String schemaColumnName)Given a catalog column name and a schema column name in an information_schema table/view, this method returns the column used for storing the catalog name, or, if there is no valid column containing the catalog name.protected StringgetDatabaseSchemaColumnName(String catalogColumnName, String schemaColumnName)Given a catalog column name and a schema column name in an information_schema table/view, this method returns the column used for storing the schema name, or, if there is no valid column containing the schema name.protected StringgetInformationSchemaColumnsDataTypeColumn()Gets the name of column in information_schema.columns for the database-specific column type.protected StringgetResultSetCatalogLabel()protected StringgetResultSetColumnNameLabel()protected StringgetResultSetColumnPositionColumn()protected StringgetResultSetColumnSizeLabel()protected StringgetResultSetDecimalDigitsLabel()protected StringgetResultSetForeignKeyColumnNameLabel()protected StringgetResultSetForeignKeyLabel()protected StringgetResultSetIndexNameLabel()protected StringgetResultSetIndexTypeLabel()protected StringgetResultSetIsNullableLabel()protected StringgetResultSetPrimaryKeyCatalogLabel()protected StringgetResultSetPrimaryKeyColumnNameLabel()protected StringgetResultSetPrimaryKeyNameLabel()protected StringgetResultSetPrimaryKeySchemaLabel()protected StringgetResultSetPrimaryKeyTableLabel()protected StringgetResultSetRemarksLabel()protected StringgetResultSetSchemaLabel()protected StringgetResultSetSqlTypeCodeLabel()protected StringgetResultSetTableNameLabel()protected StringgetResultSetTableTypeLabel()protected StringgetResultSetTableTypesPhysicalTableConstant()protected StringgetResultSetTypeNameLabel()protected <T> TprocessCatalogsResultSet(ExtractionContext.ResultSetProcessor<T> processor)protected <T> TprocessColumnsResultSet(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern, ExtractionContext.ResultSetProcessor<T> processor)protected <T> TprocessSchemaResultSet(String catalog, String schemaPattern, ExtractionContext.ResultSetProcessor<T> processor)protected <T> TprocessTableResultSet(String catalog, String schemaPattern, String tableNamePattern, String[] types, ExtractionContext.ResultSetProcessor<T> processor)-
Methods inherited from class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
addColumns, catalogExists, convertSQLException, determineCatalogFilter, determineSchemaFilter, getExtractionContext, getForeignKeys, getIndexes, getPrimaryKey, getTable, getTables, identifierHelper, interpretNullable, isPhysicalTableType, processImportedKeysResultSet, processIndexInfoResultSet, processPrimaryKeysResultSet, schemaExists, toMetaDataObjectName
-
-
-
-
Constructor Detail
-
AbstractReactiveInformationSchemaBasedExtractorImpl
public AbstractReactiveInformationSchemaBasedExtractorImpl(ExtractionContext extractionContext)
-
-
Method Detail
-
getResultSetCatalogLabel
protected String getResultSetCatalogLabel()
- Overrides:
getResultSetCatalogLabelin classAbstractInformationExtractorImpl
-
getResultSetSchemaLabel
protected String getResultSetSchemaLabel()
- Overrides:
getResultSetSchemaLabelin classAbstractInformationExtractorImpl
-
getResultSetTableNameLabel
protected String getResultSetTableNameLabel()
- Overrides:
getResultSetTableNameLabelin classAbstractInformationExtractorImpl
-
getResultSetTableTypeLabel
protected String getResultSetTableTypeLabel()
- Overrides:
getResultSetTableTypeLabelin classAbstractInformationExtractorImpl
-
getResultSetRemarksLabel
protected String getResultSetRemarksLabel()
- Overrides:
getResultSetRemarksLabelin classAbstractInformationExtractorImpl
-
getResultSetColumnNameLabel
protected String getResultSetColumnNameLabel()
- Overrides:
getResultSetColumnNameLabelin classAbstractInformationExtractorImpl
-
getResultSetSqlTypeCodeLabel
protected String getResultSetSqlTypeCodeLabel()
- Overrides:
getResultSetSqlTypeCodeLabelin classAbstractInformationExtractorImpl
-
getResultSetTypeNameLabel
protected String getResultSetTypeNameLabel()
- Overrides:
getResultSetTypeNameLabelin classAbstractInformationExtractorImpl
-
getResultSetColumnSizeLabel
protected String getResultSetColumnSizeLabel()
- Overrides:
getResultSetColumnSizeLabelin classAbstractInformationExtractorImpl
-
getResultSetDecimalDigitsLabel
protected String getResultSetDecimalDigitsLabel()
- Overrides:
getResultSetDecimalDigitsLabelin classAbstractInformationExtractorImpl
-
getResultSetIsNullableLabel
protected String getResultSetIsNullableLabel()
- Overrides:
getResultSetIsNullableLabelin classAbstractInformationExtractorImpl
-
getResultSetIndexTypeLabel
protected String getResultSetIndexTypeLabel()
- Overrides:
getResultSetIndexTypeLabelin classAbstractInformationExtractorImpl
-
getResultSetIndexNameLabel
protected String getResultSetIndexNameLabel()
- Overrides:
getResultSetIndexNameLabelin classAbstractInformationExtractorImpl
-
getResultSetForeignKeyLabel
protected String getResultSetForeignKeyLabel()
- Overrides:
getResultSetForeignKeyLabelin classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeyNameLabel
protected String getResultSetPrimaryKeyNameLabel()
- Overrides:
getResultSetPrimaryKeyNameLabelin classAbstractInformationExtractorImpl
-
getResultSetColumnPositionColumn
protected String getResultSetColumnPositionColumn()
- Overrides:
getResultSetColumnPositionColumnin classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeyColumnNameLabel
protected String getResultSetPrimaryKeyColumnNameLabel()
- Overrides:
getResultSetPrimaryKeyColumnNameLabelin classAbstractInformationExtractorImpl
-
getResultSetForeignKeyColumnNameLabel
protected String getResultSetForeignKeyColumnNameLabel()
- Overrides:
getResultSetForeignKeyColumnNameLabelin classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeyCatalogLabel
protected String getResultSetPrimaryKeyCatalogLabel()
- Overrides:
getResultSetPrimaryKeyCatalogLabelin classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeySchemaLabel
protected String getResultSetPrimaryKeySchemaLabel()
- Overrides:
getResultSetPrimaryKeySchemaLabelin classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeyTableLabel
protected String getResultSetPrimaryKeyTableLabel()
- Overrides:
getResultSetPrimaryKeyTableLabelin classAbstractInformationExtractorImpl
-
getResultSetTableTypesPhysicalTableConstant
protected String getResultSetTableTypesPhysicalTableConstant()
- Specified by:
getResultSetTableTypesPhysicalTableConstantin classAbstractInformationExtractorImpl
-
processCatalogsResultSet
protected <T> T processCatalogsResultSet(ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processCatalogsResultSetin classAbstractInformationExtractorImpl- Throws:
SQLException
-
processSchemaResultSet
protected <T> T processSchemaResultSet(String catalog, String schemaPattern, ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processSchemaResultSetin classAbstractInformationExtractorImpl- Throws:
SQLException
-
appendClauseAndParameterIfNotNullOrEmpty
protected boolean appendClauseAndParameterIfNotNullOrEmpty(String clause, Object parameter, StringBuilder sb, List<Object> parameters)
-
processTableResultSet
protected <T> T processTableResultSet(String catalog, String schemaPattern, String tableNamePattern, String[] types, ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processTableResultSetin classAbstractInformationExtractorImpl- Throws:
SQLException
-
processColumnsResultSet
protected <T> T processColumnsResultSet(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern, ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processColumnsResultSetin classAbstractInformationExtractorImpl- Throws:
SQLException
-
getInformationSchemaColumnsDataTypeColumn
protected String getInformationSchemaColumnsDataTypeColumn()
Gets the name of column in information_schema.columns for the database-specific column type.- Returns:
- the name of column in information_schema.columns for the database-specific column type
-
getDatabaseCatalogColumnName
protected String getDatabaseCatalogColumnName(String catalogColumnName, String schemaColumnName)
Given a catalog column name and a schema column name in an information_schema table/view, this method returns the column used for storing the catalog name, or, if there is no valid column containing the catalog name. MySQL, for example, uses the schema name column in the information_schema to store the catalog name. (@see MySqlReactiveInformationExtractorImpl)- Parameters:
catalogColumnName- - the catalog column nameschemaColumnName- - the schema column name- Returns:
- the column used for storing the catalog name,
or
if there is no valid column containing the catalog name.
-
getDatabaseSchemaColumnName
protected String getDatabaseSchemaColumnName(String catalogColumnName, String schemaColumnName)
Given a catalog column name and a schema column name in an information_schema table/view, this method returns the column used for storing the schema name, or, if there is no valid column containing the schema name. MySQL, for example, does not have a valid column in in the information_schema to store the schema name. (@see MySqlReactiveInformationExtractorImpl)- Parameters:
catalogColumnName- - the catalog column nameschemaColumnName- - the schema column name- Returns:
- the column used for storing the schema name,
or
if there is no valid column containing the schema name.
-
addExtractedColumnInformation
protected void addExtractedColumnInformation(TableInformation tableInformation, ResultSet resultSet) throws SQLException
- Overrides:
addExtractedColumnInformationin classAbstractInformationExtractorImpl- Throws:
SQLException
-
dataTypeCode
protected int dataTypeCode(String typeName)
Return a JDBC Type code for the given type name
-
-