org.apache.storm.cassandra

## Class DynamicStatementBuilder

- java.lang.Object
- - org.apache.storm.cassandra.DynamicStatementBuilder

- All Implemented Interfaces:
    Serializable

      public class DynamicStatementBuilder
      extends Object
      implements Serializable

  See Also:
    Serialized Form

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CqlMapper.DefaultCqlMapper` | `all()` Includes all tuple fields.
    `static CQLStatementTupleMapper` | `async(CQLStatementBuilder... builders)` Builds multiple statements which will be executed asynchronously.
    `static BoundCQLStatementMapperBuilder` | `boundQuery(ContextQuery field)` Builds a new bound statement identified by the given field.
    `static BoundCQLStatementMapperBuilder` | `boundQuery(String cql)` Builds a new bound statement based on the specified query.
    `static BatchCQLStatementTupleMapper` | `counterBatch(CQLStatementBuilder... builders)` Creates a new `BatchStatement.Type.COUNTER` batch statement for the specified CQL statement builders.
    `static FieldSelector` | `field(String name)` Maps a CQL value to the specified field from an input tuple.
    `static FieldSelector[]` | `fields(String... fields)` Maps CQL values to all specified fields from an input tuple.
    `static BatchCQLStatementTupleMapper` | `loggedBatch(CQLStatementBuilder... builders)` Creates a new `BatchStatement.Type.LOGGED` batch statement for the specified CQL statement builders.
    `static ContextQuery` | `named(String name)` Retrieves from the storm configuration the specified named query.
    `static ContextQuery` | `namedByField(String fieldName)` Retrieves from the storm configuration the named query specified by a tuple field.
    `static SimpleCQLStatementMapperBuilder` | `simpleQuery(com.datastax.driver.core.querybuilder.BuiltStatement builtStatement)`
    `static SimpleCQLStatementMapperBuilder` | `simpleQuery(String queryString)`
    `static BatchCQLStatementTupleMapper` | `unLoggedBatch(CQLStatementBuilder... builders)` Creates a new `BatchStatement.Type.UNLOGGED` batch statement for the specified CQL statement builders.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### simpleQuery

          public static final SimpleCQLStatementMapperBuilder simpleQuery(String queryString)

    - #### simpleQuery

          public static final SimpleCQLStatementMapperBuilder simpleQuery(com.datastax.driver.core.querybuilder.BuiltStatement builtStatement)

    - #### boundQuery

          public static final BoundCQLStatementMapperBuilder boundQuery(String cql)

      Builds a new bound statement based on the specified query.

      Parameters:
        `cql` - the query.
      Returns:
        a new `BoundCQLStatementMapperBuilder` instance.

    - #### boundQuery

          public static final BoundCQLStatementMapperBuilder boundQuery(ContextQuery field)

      Builds a new bound statement identified by the given field.

      Parameters:
        `field` - a context used to resolve the cassandra query.
      Returns:
        a new `BoundCQLStatementMapperBuilder` instance.

    - #### async

          public static final CQLStatementTupleMapper async(CQLStatementBuilder... builders)

      Builds multiple statements which will be executed asynchronously.

      Parameters:
        `builders` - a list of `CQLStatementBuilder`.
      Returns:
        a new `CQLStatementTupleMapper`.

    - #### loggedBatch

          public static final BatchCQLStatementTupleMapper loggedBatch(CQLStatementBuilder... builders)

      Creates a new `BatchStatement.Type.LOGGED` batch statement for the specified CQL statement builders.

    - #### counterBatch

          public static final BatchCQLStatementTupleMapper counterBatch(CQLStatementBuilder... builders)

      Creates a new `BatchStatement.Type.COUNTER` batch statement for the specified CQL statement builders.

    - #### unLoggedBatch

          public static final BatchCQLStatementTupleMapper unLoggedBatch(CQLStatementBuilder... builders)

      Creates a new `BatchStatement.Type.UNLOGGED` batch statement for the specified CQL statement builders.

    - #### named

          public static final ContextQuery named(String name)

      Retrieves from the storm configuration the specified named query.

      Parameters:
        `name` - query’s name.

    - #### namedByField

          public static final ContextQuery namedByField(String fieldName)

      Retrieves from the storm configuration the named query specified by a tuple field.

      Parameters:
        `fieldName` - field’s name that contains the named of the query.

    - #### field

          public static final FieldSelector field(String name)

      Maps a CQL value to the specified field from an input tuple.

      Parameters:
        `name` - the name of a tuple field.
      Returns:
        a new `FieldSelector`.

    - #### fields

          public static final FieldSelector[] fields(String... fields)

      Maps CQL values to all specified fields from an input tuple.

      Parameters:
        `fields` - a list of tuple fields
      Returns:
        a list of `FieldSelector`.

    - #### all

          public static final CqlMapper.DefaultCqlMapper all()

      Includes all tuple fields.

Copyright © 2021 The Apache Software Foundation. All rights reserved.