Class StringBasedCassandraQuery
java.lang.Object
org.springframework.data.cassandra.repository.query.CassandraRepositoryQuerySupport
org.springframework.data.cassandra.repository.query.AbstractCassandraQuery
org.springframework.data.cassandra.repository.query.StringBasedCassandraQuery
- All Implemented Interfaces:
RepositoryQuery
String-based
AbstractCassandraQuery
implementation.
A StringBasedCassandraQuery
expects a query method to be annotated with
Query
with a CQL query. String-based queries support named,
index-based and expression parameters that are resolved during query execution.
- Author:
- Matthew Adams, Mark Paluch
- See Also:
-
Field Summary
Fields inherited from class org.springframework.data.cassandra.repository.query.CassandraRepositoryQuerySupport
log
-
Constructor Summary
ConstructorDescriptionStringBasedCassandraQuery
(String query, CassandraQueryMethod method, CassandraOperations operations, ExpressionParser expressionParser, QueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedCassandraQuery
for the givenquery
,CassandraQueryMethod
,CassandraOperations
,SpelExpressionParser
, andQueryMethodEvaluationContextProvider
.StringBasedCassandraQuery
(CassandraQueryMethod queryMethod, CassandraOperations operations, ExpressionParser expressionParser, QueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedCassandraQuery
for the givenCassandraQueryMethod
,CassandraOperations
,SpelExpressionParser
, andQueryMethodEvaluationContextProvider
. -
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.oss.driver.api.core.cql.SimpleStatement
createQuery
(CassandraParameterAccessor parameterAccessor) Creates aStatement
using the givenParameterAccessor
protected org.springframework.data.cassandra.repository.query.StringBasedQuery
protected boolean
Returns whether the query should get a count projection applied.protected boolean
Returns whether the query should get an exists projection applied.protected boolean
Return whether the query has an explicit limit set.protected boolean
Returns whether the query is a modifying query.Methods inherited from class org.springframework.data.cassandra.repository.query.AbstractCassandraQuery
execute, getOperations
Methods inherited from class org.springframework.data.cassandra.repository.query.CassandraRepositoryQuerySupport
getEntityInstantiators, getMappingContext, getQueryMethod, getQueryStatementCreator
-
Constructor Details
-
StringBasedCassandraQuery
public StringBasedCassandraQuery(CassandraQueryMethod queryMethod, CassandraOperations operations, ExpressionParser expressionParser, QueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedCassandraQuery
for the givenCassandraQueryMethod
,CassandraOperations
,SpelExpressionParser
, andQueryMethodEvaluationContextProvider
.- Parameters:
queryMethod
-CassandraQueryMethod
on which this query is based.operations
-CassandraOperations
used to perform data access in Cassandra.expressionParser
-SpelExpressionParser
used to parse expressions in the query.evaluationContextProvider
-QueryMethodEvaluationContextProvider
used to access the potentially sharedStandardEvaluationContext
.- See Also:
-
StringBasedCassandraQuery
public StringBasedCassandraQuery(String query, CassandraQueryMethod method, CassandraOperations operations, ExpressionParser expressionParser, QueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedCassandraQuery
for the givenquery
,CassandraQueryMethod
,CassandraOperations
,SpelExpressionParser
, andQueryMethodEvaluationContextProvider
.- Parameters:
query
-String
containing the Apache Cassandra CQL query to execute.method
-CassandraQueryMethod
on which this query is based.operations
-CassandraOperations
used to perform data access in Cassandra.expressionParser
-SpelExpressionParser
used to parse expressions in the query.evaluationContextProvider
-QueryMethodEvaluationContextProvider
used to access the potentially sharedStandardEvaluationContext
.- See Also:
-
-
Method Details
-
getStringBasedQuery
protected org.springframework.data.cassandra.repository.query.StringBasedQuery getStringBasedQuery() -
createQuery
public com.datastax.oss.driver.api.core.cql.SimpleStatement createQuery(CassandraParameterAccessor parameterAccessor) Description copied from class:AbstractCassandraQuery
Creates aStatement
using the givenParameterAccessor
- Specified by:
createQuery
in classAbstractCassandraQuery
- Parameters:
parameterAccessor
- must not be null.
-
isCountQuery
protected boolean isCountQuery()Description copied from class:AbstractCassandraQuery
Returns whether the query should get a count projection applied.- Specified by:
isCountQuery
in classAbstractCassandraQuery
- Returns:
- a boolean value indicating whether the query is a count projection.
-
isExistsQuery
protected boolean isExistsQuery()Description copied from class:AbstractCassandraQuery
Returns whether the query should get an exists projection applied.- Specified by:
isExistsQuery
in classAbstractCassandraQuery
- Returns:
- a boolean value indicating whether the query is an exists projection.
-
isLimiting
protected boolean isLimiting()Description copied from class:AbstractCassandraQuery
Return whether the query has an explicit limit set.- Specified by:
isLimiting
in classAbstractCassandraQuery
- Returns:
- a boolean value indicating whether the query has an explicit limit set.
-
isModifyingQuery
protected boolean isModifyingQuery()Description copied from class:AbstractCassandraQuery
Returns whether the query is a modifying query.- Specified by:
isModifyingQuery
in classAbstractCassandraQuery
- Returns:
- a boolean value indicating whether the query is a modifying query.
-