Class MySqlReactiveInformationExtractorImpl
- java.lang.Object
-
- org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
- org.hibernate.reactive.provider.service.AbstractReactiveInformationSchemaBasedExtractorImpl
-
- org.hibernate.reactive.provider.service.MySqlReactiveInformationExtractorImpl
-
- All Implemented Interfaces:
InformationExtractor
public class MySqlReactiveInformationExtractorImpl extends AbstractReactiveInformationSchemaBasedExtractorImpl
An implementation ofAbstractReactiveInformationSchemaBasedExtractorImplspecifically for MySQL that obtains metadata from MySQL's non-standard information_schema tables. MySQL's schema is actually a catalog. MySQL's implementation ofDatabaseMetaDataautomatically changes catalog arguments to refer to schema columns instead. Unfortunately, MySQL's information_schema stores catalog names in a schema name column. This class works around that idiosyncrasy.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl.ForeignKeyBuilder, org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl.ForeignKeyBuilderImpl
-
-
Constructor Summary
Constructors Constructor Description MySqlReactiveInformationExtractorImpl(ExtractionContext extractionContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 StringgetResultSetTableTypesPhysicalTableConstant()protected <T> TprocessCatalogsResultSet(ExtractionContext.ResultSetProcessor<T> processor)protected <T> TprocessImportedKeysResultSet(String catalog, String schema, String table, ExtractionContext.ResultSetProcessor<T> processor)protected <T> TprocessIndexInfoResultSet(String catalog, String schema, String table, boolean unique, boolean approximate, ExtractionContext.ResultSetProcessor<T> processor)protected <T> TprocessPrimaryKeysResultSet(String catalogFilter, String schemaFilter, Identifier tableName, ExtractionContext.ResultSetProcessor<T> processor)-
Methods inherited from class org.hibernate.reactive.provider.service.AbstractReactiveInformationSchemaBasedExtractorImpl
addExtractedColumnInformation, appendClauseAndParameterIfNotNullOrEmpty, getInformationSchemaColumnsDataTypeColumn, getResultSetCatalogLabel, getResultSetColumnNameLabel, getResultSetColumnPositionColumn, getResultSetColumnSizeLabel, getResultSetDecimalDigitsLabel, getResultSetForeignKeyColumnNameLabel, getResultSetForeignKeyLabel, getResultSetIndexNameLabel, getResultSetIndexTypeLabel, getResultSetIsNullableLabel, getResultSetPrimaryKeyCatalogLabel, getResultSetPrimaryKeyColumnNameLabel, getResultSetPrimaryKeyNameLabel, getResultSetPrimaryKeySchemaLabel, getResultSetPrimaryKeyTableLabel, getResultSetRemarksLabel, getResultSetSchemaLabel, getResultSetSqlTypeCodeLabel, getResultSetTableNameLabel, getResultSetTableTypeLabel, getResultSetTypeNameLabel, processColumnsResultSet, processCrossReferenceResultSet, processSchemaResultSet, processTableResultSet
-
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, schemaExists, toMetaDataObjectName
-
-
-
-
Constructor Detail
-
MySqlReactiveInformationExtractorImpl
public MySqlReactiveInformationExtractorImpl(ExtractionContext extractionContext)
-
-
Method Detail
-
dataTypeCode
protected int dataTypeCode(String typeName)
Description copied from class:AbstractReactiveInformationSchemaBasedExtractorImplReturn a JDBC Type code for the given type name- Overrides:
dataTypeCodein classAbstractReactiveInformationSchemaBasedExtractorImpl
-
getResultSetTableTypesPhysicalTableConstant
protected String getResultSetTableTypesPhysicalTableConstant()
-
getDatabaseCatalogColumnName
protected String getDatabaseCatalogColumnName(String catalogColumnName, String schemaColumnName)
Description copied from class:AbstractReactiveInformationSchemaBasedExtractorImplGiven 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)- Overrides:
getDatabaseCatalogColumnNamein classAbstractReactiveInformationSchemaBasedExtractorImpl- 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)
Description copied from class:AbstractReactiveInformationSchemaBasedExtractorImplGiven 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)- Overrides:
getDatabaseSchemaColumnNamein classAbstractReactiveInformationSchemaBasedExtractorImpl- 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.
-
processPrimaryKeysResultSet
protected <T> T processPrimaryKeysResultSet(String catalogFilter, String schemaFilter, Identifier tableName, ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processPrimaryKeysResultSetin classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl- Throws:
SQLException
-
processCatalogsResultSet
protected <T> T processCatalogsResultSet(ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Overrides:
processCatalogsResultSetin classAbstractReactiveInformationSchemaBasedExtractorImpl- Throws:
SQLException
-
processIndexInfoResultSet
protected <T> T processIndexInfoResultSet(String catalog, String schema, String table, boolean unique, boolean approximate, ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processIndexInfoResultSetin classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl- Throws:
SQLException
-
processImportedKeysResultSet
protected <T> T processImportedKeysResultSet(String catalog, String schema, String table, ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
- Specified by:
processImportedKeysResultSetin classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl- Throws:
SQLException
-
-