Class QueryOptionsUtil

java.lang.Object
org.springframework.data.cassandra.core.cql.QueryOptionsUtil

public abstract class QueryOptionsUtil extends Object
Utility class to associate QueryOptions and WriteOptions with QueryBuilder Statements.
Since:
2.0
Author:
Mark Paluch, Lukasz Antoniak, Tomasz Lelek, Sam Lightfoot
  • Constructor Details

    • QueryOptionsUtil

      public QueryOptionsUtil()
  • Method Details

    • addQueryOptions

      public static <T extends com.datastax.oss.driver.api.core.cql.Statement<?>> T addQueryOptions(T statement, QueryOptions queryOptions)
      Add common QueryOptions to all types of queries.
      Parameters:
      statement - CQL Statement, must not be null.
      queryOptions - query options (e.g. consistency level) to add to the CQL statement.
      Returns:
      the given Statement.
    • addWriteOptions

      public static com.datastax.oss.driver.api.querybuilder.insert.Insert addWriteOptions(com.datastax.oss.driver.api.querybuilder.insert.Insert insert, WriteOptions writeOptions)
      Add common WriteOptions options to Insert CQL statements.
      Parameters:
      insert - Insert CQL statement, must not be null.
      writeOptions - write options (e.g. consistency level) to add to the CQL statement.
      Returns:
      the given Insert.
    • addWriteOptions

      public static com.datastax.oss.driver.api.querybuilder.update.Update addWriteOptions(com.datastax.oss.driver.api.querybuilder.update.Update update, WriteOptions writeOptions)
      Add common WriteOptions options to Update CQL statements.
      Parameters:
      update - Update CQL statement, must not be null.
      writeOptions - write options (e.g. consistency level) to add to the CQL statement.
      Returns:
      the given Update.
    • addWriteOptions

      public static com.datastax.oss.driver.api.querybuilder.delete.Delete addWriteOptions(com.datastax.oss.driver.api.querybuilder.delete.Delete delete, WriteOptions writeOptions)
      Add common WriteOptions options to Delete CQL statements.
      Parameters:
      delete - Delete CQL statement, must not be null.
      writeOptions - write options (e.g. consistency level) to add to the CQL statement.
      Returns:
      the given Delete.
      Since:
      2.1
    • addWriteOptions

      public static <T> T addWriteOptions(QueryOptionsUtil.CqlStatementOptionsAccessor<T> accessor, WriteOptions writeOptions)
      Add common WriteOptions options to CQL statements through QueryOptionsUtil.CqlStatementOptionsAccessor.
      Parameters:
      accessor - CQL statement accessor, must not be null.
      writeOptions - write options (e.g. consistency level) to add to the CQL statement.
      Returns:
      the resulting statement.
      Since:
      4.2