Class CreateJsonIndexGenerator
- java.lang.Object
-
- liquibase.sqlgenerator.core.AbstractSqlGenerator<CreateJsonIndexStatement>
-
- org.keycloak.models.map.storage.jpa.liquibase.extension.CreateJsonIndexGenerator
-
- All Implemented Interfaces:
liquibase.servicelocator.PrioritizedService
,liquibase.sqlgenerator.SqlGenerator<CreateJsonIndexStatement>
public class CreateJsonIndexGenerator extends liquibase.sqlgenerator.core.AbstractSqlGenerator<CreateJsonIndexStatement>
ASqlGenerator
implementation that supportsCreateJsonIndexStatement
s. 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 Summary
Constructors Constructor Description CreateJsonIndexGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description liquibase.sql.Sql[]
generateSql(CreateJsonIndexStatement statement, liquibase.database.Database database, liquibase.sqlgenerator.SqlGeneratorChain sqlGeneratorChain)
protected liquibase.structure.core.Index
getAffectedIndex(liquibase.statement.core.CreateIndexStatement statement)
int
getPriority()
Override the priority.protected void
handleJsonIndex(CreateJsonIndexStatement statement, liquibase.database.Database database, StringBuilder builder)
liquibase.exception.ValidationErrors
validate(CreateJsonIndexStatement createIndexStatement, liquibase.database.Database database, liquibase.sqlgenerator.SqlGeneratorChain sqlGeneratorChain)
-
-
-
Method Detail
-
getPriority
public int getPriority()
Override the priority. This is needed becauseCreateJsonIndexStatement
is a subtype ofCreateIndexStatement
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 interfaceliquibase.servicelocator.PrioritizedService
- Specified by:
getPriority
in interfaceliquibase.sqlgenerator.SqlGenerator<CreateJsonIndexStatement>
- Overrides:
getPriority
in classliquibase.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)
-
handleJsonIndex
protected void handleJsonIndex(CreateJsonIndexStatement statement, liquibase.database.Database database, StringBuilder builder)
-
getAffectedIndex
protected liquibase.structure.core.Index getAffectedIndex(liquibase.statement.core.CreateIndexStatement statement)
-
-