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 ofInformationExtractor
that 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 void
addExtractedColumnInformation(TableInformation tableInformation, ResultSet resultSet)
protected boolean
appendClauseAndParameterIfNotNullOrEmpty(String clause, Object parameter, StringBuilder sb, List<Object> parameters)
protected int
dataTypeCode(String typeName)
Return a JDBC Type code for the given type nameprotected 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.
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.
protected String
getInformationSchemaColumnsDataTypeColumn()
Gets the name of column in information_schema.columns for the database-specific column type.protected String
getResultSetCatalogLabel()
protected String
getResultSetColumnNameLabel()
protected String
getResultSetColumnPositionColumn()
protected String
getResultSetColumnSizeLabel()
protected String
getResultSetDecimalDigitsLabel()
protected String
getResultSetForeignKeyColumnNameLabel()
protected String
getResultSetForeignKeyLabel()
protected String
getResultSetIndexNameLabel()
protected String
getResultSetIndexTypeLabel()
protected String
getResultSetIsNullableLabel()
protected String
getResultSetPrimaryKeyCatalogLabel()
protected String
getResultSetPrimaryKeyColumnNameLabel()
protected String
getResultSetPrimaryKeyNameLabel()
protected String
getResultSetPrimaryKeySchemaLabel()
protected String
getResultSetPrimaryKeyTableLabel()
protected String
getResultSetRemarksLabel()
protected String
getResultSetSchemaLabel()
protected String
getResultSetSqlTypeCodeLabel()
protected String
getResultSetTableNameLabel()
protected String
getResultSetTableTypeLabel()
protected String
getResultSetTableTypesPhysicalTableConstant()
protected String
getResultSetTypeNameLabel()
protected <T> T
processCatalogsResultSet(ExtractionContext.ResultSetProcessor<T> processor)
protected <T> T
processColumnsResultSet(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern, ExtractionContext.ResultSetProcessor<T> processor)
protected <T> T
processSchemaResultSet(String catalog, String schemaPattern, ExtractionContext.ResultSetProcessor<T> processor)
protected <T> T
processTableResultSet(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:
getResultSetCatalogLabel
in classAbstractInformationExtractorImpl
-
getResultSetSchemaLabel
protected String getResultSetSchemaLabel()
- Overrides:
getResultSetSchemaLabel
in classAbstractInformationExtractorImpl
-
getResultSetTableNameLabel
protected String getResultSetTableNameLabel()
- Overrides:
getResultSetTableNameLabel
in classAbstractInformationExtractorImpl
-
getResultSetTableTypeLabel
protected String getResultSetTableTypeLabel()
- Overrides:
getResultSetTableTypeLabel
in classAbstractInformationExtractorImpl
-
getResultSetRemarksLabel
protected String getResultSetRemarksLabel()
- Overrides:
getResultSetRemarksLabel
in classAbstractInformationExtractorImpl
-
getResultSetColumnNameLabel
protected String getResultSetColumnNameLabel()
- Overrides:
getResultSetColumnNameLabel
in classAbstractInformationExtractorImpl
-
getResultSetSqlTypeCodeLabel
protected String getResultSetSqlTypeCodeLabel()
- Overrides:
getResultSetSqlTypeCodeLabel
in classAbstractInformationExtractorImpl
-
getResultSetTypeNameLabel
protected String getResultSetTypeNameLabel()
- Overrides:
getResultSetTypeNameLabel
in classAbstractInformationExtractorImpl
-
getResultSetColumnSizeLabel
protected String getResultSetColumnSizeLabel()
- Overrides:
getResultSetColumnSizeLabel
in classAbstractInformationExtractorImpl
-
getResultSetDecimalDigitsLabel
protected String getResultSetDecimalDigitsLabel()
- Overrides:
getResultSetDecimalDigitsLabel
in classAbstractInformationExtractorImpl
-
getResultSetIsNullableLabel
protected String getResultSetIsNullableLabel()
- Overrides:
getResultSetIsNullableLabel
in classAbstractInformationExtractorImpl
-
getResultSetIndexTypeLabel
protected String getResultSetIndexTypeLabel()
- Overrides:
getResultSetIndexTypeLabel
in classAbstractInformationExtractorImpl
-
getResultSetIndexNameLabel
protected String getResultSetIndexNameLabel()
- Overrides:
getResultSetIndexNameLabel
in classAbstractInformationExtractorImpl
-
getResultSetForeignKeyLabel
protected String getResultSetForeignKeyLabel()
- Overrides:
getResultSetForeignKeyLabel
in classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeyNameLabel
protected String getResultSetPrimaryKeyNameLabel()
- Overrides:
getResultSetPrimaryKeyNameLabel
in classAbstractInformationExtractorImpl
-
getResultSetColumnPositionColumn
protected String getResultSetColumnPositionColumn()
- Overrides:
getResultSetColumnPositionColumn
in classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeyColumnNameLabel
protected String getResultSetPrimaryKeyColumnNameLabel()
- Overrides:
getResultSetPrimaryKeyColumnNameLabel
in classAbstractInformationExtractorImpl
-
getResultSetForeignKeyColumnNameLabel
protected String getResultSetForeignKeyColumnNameLabel()
- Overrides:
getResultSetForeignKeyColumnNameLabel
in classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeyCatalogLabel
protected String getResultSetPrimaryKeyCatalogLabel()
- Overrides:
getResultSetPrimaryKeyCatalogLabel
in classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeySchemaLabel
protected String getResultSetPrimaryKeySchemaLabel()
- Overrides:
getResultSetPrimaryKeySchemaLabel
in classAbstractInformationExtractorImpl
-
getResultSetPrimaryKeyTableLabel
protected String getResultSetPrimaryKeyTableLabel()
- Overrides:
getResultSetPrimaryKeyTableLabel
in classAbstractInformationExtractorImpl
-
getResultSetTableTypesPhysicalTableConstant
protected String getResultSetTableTypesPhysicalTableConstant()
- Specified by:
getResultSetTableTypesPhysicalTableConstant
in classAbstractInformationExtractorImpl
-
processCatalogsResultSet
protected <T> T processCatalogsResultSet(ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processCatalogsResultSet
in classAbstractInformationExtractorImpl
- Throws:
SQLException
-
processSchemaResultSet
protected <T> T processSchemaResultSet(String catalog, String schemaPattern, ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processSchemaResultSet
in 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:
processTableResultSet
in classAbstractInformationExtractorImpl
- Throws:
SQLException
-
processColumnsResultSet
protected <T> T processColumnsResultSet(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern, ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processColumnsResultSet
in 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:
addExtractedColumnInformation
in classAbstractInformationExtractorImpl
- Throws:
SQLException
-
dataTypeCode
protected int dataTypeCode(String typeName)
Return a JDBC Type code for the given type name
-
-