Class CreateJsonIndexGenerator

  • All Implemented Interfaces:
    liquibase.servicelocator.PrioritizedService, liquibase.sqlgenerator.SqlGenerator<CreateJsonIndexStatement>

    public class CreateJsonIndexGenerator
    extends liquibase.sqlgenerator.core.AbstractSqlGenerator<CreateJsonIndexStatement>
    A SqlGenerator implementation that supports CreateJsonIndexStatements. It generates the SQL required to create an index for properties of JSON files stored in one of the table columns.
    Author:
    Stefan Guilhen
    • Constructor Detail

      • CreateJsonIndexGenerator

        public CreateJsonIndexGenerator()
    • Method Detail

      • getPriority

        public int getPriority()
        Override the priority. This is needed because CreateJsonIndexStatement is a subtype of CreateIndexStatement and is thus a match for the standard index generators. By increasing the priority we ensure this is processed before the other generators.
        Specified by:
        getPriority in interface liquibase.servicelocator.PrioritizedService
        Specified by:
        getPriority in interface liquibase.sqlgenerator.SqlGenerator<CreateJsonIndexStatement>
        Overrides:
        getPriority in class liquibase.sqlgenerator.core.AbstractSqlGenerator<CreateJsonIndexStatement>
        Returns:
        this generator's priority.
      • validate

        public liquibase.exception.ValidationErrors validate​(CreateJsonIndexStatement createIndexStatement,
                                                             liquibase.database.Database database,
                                                             liquibase.sqlgenerator.SqlGeneratorChain sqlGeneratorChain)
      • generateSql

        public liquibase.sql.Sql[] generateSql​(CreateJsonIndexStatement statement,
                                               liquibase.database.Database database,
                                               liquibase.sqlgenerator.SqlGeneratorChain sqlGeneratorChain)
      • getAffectedIndex

        protected liquibase.structure.core.Index getAffectedIndex​(liquibase.statement.core.CreateIndexStatement statement)