Class QueryOptionsUtil
java.lang.Object
org.springframework.data.cassandra.core.cql.QueryOptionsUtil
- Since:
- 2.0
- Author:
- Mark Paluch, Lukasz Antoniak, Tomasz Lelek, Sam Lightfoot
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Wrapper for common options used with CQL statements that are represented in the CQL statement such as TTL and timestamp. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends com.datastax.oss.driver.api.core.cql.Statement<?>>
TaddQueryOptions
(T statement, QueryOptions queryOptions) Add commonQueryOptions
to all types of queries.static com.datastax.oss.driver.api.querybuilder.delete.Delete
addWriteOptions
(com.datastax.oss.driver.api.querybuilder.delete.Delete delete, WriteOptions writeOptions) Add commonWriteOptions
options toDelete
CQL statements.static com.datastax.oss.driver.api.querybuilder.insert.Insert
addWriteOptions
(com.datastax.oss.driver.api.querybuilder.insert.Insert insert, WriteOptions writeOptions) Add commonWriteOptions
options toInsert
CQL statements.static com.datastax.oss.driver.api.querybuilder.update.Update
addWriteOptions
(com.datastax.oss.driver.api.querybuilder.update.Update update, WriteOptions writeOptions) Add commonWriteOptions
options toUpdate
CQL statements.static <T> T
addWriteOptions
(QueryOptionsUtil.CqlStatementOptionsAccessor<T> accessor, WriteOptions writeOptions) Add commonWriteOptions
options to CQL statements throughQueryOptionsUtil.CqlStatementOptionsAccessor
.
-
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 commonQueryOptions
to all types of queries.- Parameters:
statement
- CQLStatement
, 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 commonWriteOptions
options toInsert
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 commonWriteOptions
options toUpdate
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 commonWriteOptions
options toDelete
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 commonWriteOptions
options to CQL statements throughQueryOptionsUtil.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
-