Class 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 Detail

      • MySqlReactiveInformationExtractorImpl

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

      • getDatabaseCatalogColumnName

        protected java.lang.String getDatabaseCatalogColumnName​(java.lang.String catalogColumnName,
                                                                java.lang.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 java.lang.String getDatabaseSchemaColumnName​(java.lang.String catalogColumnName,
                                                               java.lang.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)

        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​(java.lang.String catalogFilter,
                                                    java.lang.String schemaFilter,
                                                    org.hibernate.boot.model.naming.Identifier tableName,
                                                    org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor)
                                             throws java.sql.SQLException
        Specified by:
        processPrimaryKeysResultSet in class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
        Throws:
        java.sql.SQLException
      • processIndexInfoResultSet

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

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