Class AbstractCqlExecMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    AbstractCqlLoadMojo, CqlExecCassandraMojo

    public abstract class AbstractCqlExecMojo
    extends AbstractCassandraMojo
    Abstract parent class for mojos that need to run CQL statements.
    Author:
    sparhomenko
    • Field Detail

      • cqlEncoding

        @Parameter(property="cql.encoding")
        protected String cqlEncoding
        Charset used when loading CQL files. If not specified the system default encoding will be used.
        Since:
        3.6
      • useCqlLexer

        @Parameter(defaultValue="false")
        protected boolean useCqlLexer
        Should we use the CqlLexer when loading the cql file. This should be better than than the default behaviour which is to just split input on ; since it handles ; in comments and strings. It is not enabled by default since has not been extensively tested.
        Since:
        3.7
    • Constructor Detail

      • AbstractCqlExecMojo

        public AbstractCqlExecMojo()
    • Method Detail

      • readFile

        protected String readFile​(File file)
                           throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • executeCql

        protected List<com.datastax.oss.driver.api.core.cql.Row> executeCql​(String statements)
                                                                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • splitStatementsUsingCqlLexer

        protected static List<String> splitStatementsUsingCqlLexer​(String statements)
        Best effort to somewhat parse the cql input instead of just splitting on ; which breaks badly if you have ; in strings or comments. Parsing is done using the CqlLexer class