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:
org.hibernate.tool.schema.extract.spi.InformationExtractor

public class MySqlReactiveInformationExtractorImpl extends AbstractReactiveInformationSchemaBasedExtractorImpl
An implementation of AbstractReactiveInformationSchemaBasedExtractorImpl specifically for MySQL that obtains metadata from MySQL's non-standard information_schema tables.

MySQL's schema is actually a catalog. MySQL's implementation of DatabaseMetaData automatically 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.

  • Constructor Details

    • MySqlReactiveInformationExtractorImpl

      public MySqlReactiveInformationExtractorImpl(org.hibernate.tool.schema.extract.spi.ExtractionContext extractionContext)
  • Method Details

    • dataTypeCode

      protected int dataTypeCode(String typeName)
      Return a JDBC Type code for the given type name
      Overrides:
      dataTypeCode in class AbstractReactiveInformationSchemaBasedExtractorImpl
    • 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)

      Overrides:
      getDatabaseCatalogColumnName in class AbstractReactiveInformationSchemaBasedExtractorImpl
      Parameters:
      catalogColumnName - - the catalog column name
      schemaColumnName - - 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 the information_schema to store the schema name. (@see MySqlReactiveInformationExtractorImpl)

      Overrides:
      getDatabaseSchemaColumnName in class AbstractReactiveInformationSchemaBasedExtractorImpl
      Parameters:
      catalogColumnName - - the catalog column name
      schemaColumnName - - 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, org.hibernate.boot.model.naming.Identifier tableName, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor)
      Specified by:
      processPrimaryKeysResultSet in class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
    • processCatalogsResultSet

      protected <T> T processCatalogsResultSet(org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
      Overrides:
      processCatalogsResultSet in class AbstractReactiveInformationSchemaBasedExtractorImpl
      Throws:
      SQLException
    • processIndexInfoResultSet

      protected <T> T processIndexInfoResultSet(String catalog, String schema, String table, boolean unique, boolean approximate, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
      Specified by:
      processIndexInfoResultSet in class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
      Throws:
      SQLException
    • processImportedKeysResultSet

      protected <T> T processImportedKeysResultSet(String catalog, String schema, String table, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor) throws SQLException
      Specified by:
      processImportedKeysResultSet in class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
      Throws:
      SQLException