Class QueryOptions

java.lang.Object
org.springframework.data.cassandra.core.cql.QueryOptions
Direct Known Subclasses:
WriteOptions

public class QueryOptions extends Object
Cassandra Query Options for queries. QueryOptions allow tuning of various query options on a per-request level. Only options that are set are applied to queries.
Author:
David Webb, Mark Paluch, Tomasz Lelek, Sam Lightfoot
  • Constructor Details

  • Method Details

    • builder

      public static QueryOptions.QueryOptionsBuilder builder()
      Returns:
      a new QueryOptions.QueryOptionsBuilder.
      Since:
      1.5
    • empty

      public static QueryOptions empty()
      Create default QueryOptions.
      Returns:
      default QueryOptions.
      Since:
      2.0
    • mutate

      Create a new QueryOptions.QueryOptionsBuilder to mutate properties of this QueryOptions.
      Returns:
      a new QueryOptions.QueryOptionsBuilder initialized with this QueryOptions.
      Since:
      2.0
    • getConsistencyLevel

      @Nullable protected com.datastax.oss.driver.api.core.ConsistencyLevel getConsistencyLevel()
      Returns:
      the driver ConsistencyLevel.
      Since:
      1.5
    • getExecutionProfileResolver

      protected ExecutionProfileResolver getExecutionProfileResolver()
      Returns:
      the ExecutionProfileResolver.
      Since:
      3.0
    • isIdempotent

      @Nullable protected Boolean isIdempotent()
      Returns:
      whether query is idempotent. May be null if not set.
      Since:
      3.4
      See Also:
      • Statement.setIdempotent(Boolean)
    • getKeyspace

      @Nullable public com.datastax.oss.driver.api.core.CqlIdentifier getKeyspace()
      Returns:
      the keyspace associated with the query. If it is null, it means that either keyspace configured on the statement or from the CqlSession will be used.
      Since:
      3.1
    • getPageSize

      @Nullable protected Integer getPageSize()
      Returns:
      the number of rows to fetch per chunking request. May be null if not set.
      Since:
      1.5
    • getReadTimeout

      @Deprecated protected Duration getReadTimeout()
      Deprecated.
      since 3.0, use getTimeout() instead.
      Returns:
      the command timeout. May be negative if not set.
      Since:
      1.5
      See Also:
      • Statement.setTimeout(Duration)
    • getRoutingKeyspace

      @Nullable protected com.datastax.oss.driver.api.core.CqlIdentifier getRoutingKeyspace()
      Returns:
      the keyspace used for token-aware routing. May be null if token-aware routing is disabled.
      Since:
      3.4
      See Also:
      • Statement.setRoutingKeyspace(CqlIdentifier)
    • getRoutingKey

      @Nullable protected ByteBuffer getRoutingKey()
      Returns:
      the key used for token-aware routing. May be null if token-aware routing is disabled.
      Since:
      3.4
      See Also:
      • Statement.setRoutingKey(ByteBuffer)
    • getTimeout

      protected Duration getTimeout()
      Returns:
      the command timeout. May be negative if not set.
      Since:
      3.0
      See Also:
      • Statement.setTimeout(Duration)
    • getSerialConsistencyLevel

      @Nullable protected com.datastax.oss.driver.api.core.ConsistencyLevel getSerialConsistencyLevel()
      Returns:
      the serial ConsistencyLevel.
      Since:
      3.0
      See Also:
      • Statement.setSerialConsistencyLevel(ConsistencyLevel)
    • getTracing

      @Nullable protected Boolean getTracing()
      Returns:
      whether to enable tracing. May be null if not set.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object