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:
org.springframework.data.repository.query.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
ConstructorsConstructorDescriptionStringBasedCassandraQuery(String query, CassandraQueryMethod method, CassandraOperations operations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedCassandraQueryfor the givenquery,CassandraQueryMethod,CassandraOperations,SpelExpressionParser, andQueryMethodEvaluationContextProvider.StringBasedCassandraQuery(CassandraQueryMethod queryMethod, CassandraOperations operations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedCassandraQueryfor the givenCassandraQueryMethod,CassandraOperations,SpelExpressionParser, andQueryMethodEvaluationContextProvider. -
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.oss.driver.api.core.cql.SimpleStatementcreateQuery(CassandraParameterAccessor parameterAccessor) Creates aStatementusing the givenParameterAccessorprotected org.springframework.data.cassandra.repository.query.StringBasedQueryprotected booleanReturns whether the query should get a count projection applied.protected booleanReturns whether the query should get an exists projection applied.protected booleanReturn whether the query has an explicit limit set.protected booleanReturns whether the query is a modifying query.Methods inherited from class org.springframework.data.cassandra.repository.query.AbstractCassandraQuery
execute, getOperationsMethods inherited from class org.springframework.data.cassandra.repository.query.CassandraRepositoryQuerySupport
getEntityInstantiators, getMappingContext, getQueryMethod, getQueryStatementCreator
-
Constructor Details
-
StringBasedCassandraQuery
public StringBasedCassandraQuery(CassandraQueryMethod queryMethod, CassandraOperations operations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedCassandraQueryfor the givenCassandraQueryMethod,CassandraOperations,SpelExpressionParser, andQueryMethodEvaluationContextProvider.- Parameters:
queryMethod-CassandraQueryMethodon which this query is based.operations-CassandraOperationsused to perform data access in Cassandra.expressionParser-SpelExpressionParserused to parse expressions in the query.evaluationContextProvider-QueryMethodEvaluationContextProviderused to access the potentially sharedStandardEvaluationContext.- See Also:
-
StringBasedCassandraQuery
public StringBasedCassandraQuery(String query, CassandraQueryMethod method, CassandraOperations operations, org.springframework.expression.ExpressionParser expressionParser, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedCassandraQueryfor the givenquery,CassandraQueryMethod,CassandraOperations,SpelExpressionParser, andQueryMethodEvaluationContextProvider.- Parameters:
query-Stringcontaining the Apache Cassandra CQL query to execute.method-CassandraQueryMethodon which this query is based.operations-CassandraOperationsused to perform data access in Cassandra.expressionParser-SpelExpressionParserused to parse expressions in the query.evaluationContextProvider-QueryMethodEvaluationContextProviderused 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:AbstractCassandraQueryCreates aStatementusing the givenParameterAccessor- Specified by:
createQueryin classAbstractCassandraQuery- Parameters:
parameterAccessor- must not be null.
-
isCountQuery
protected boolean isCountQuery()Description copied from class:AbstractCassandraQueryReturns whether the query should get a count projection applied.- Specified by:
isCountQueryin classAbstractCassandraQuery- Returns:
- a boolean value indicating whether the query is a count projection.
-
isExistsQuery
protected boolean isExistsQuery()Description copied from class:AbstractCassandraQueryReturns whether the query should get an exists projection applied.- Specified by:
isExistsQueryin classAbstractCassandraQuery- Returns:
- a boolean value indicating whether the query is an exists projection.
-
isLimiting
protected boolean isLimiting()Description copied from class:AbstractCassandraQueryReturn whether the query has an explicit limit set.- Specified by:
isLimitingin classAbstractCassandraQuery- Returns:
- a boolean value indicating whether the query has an explicit limit set.
-
isModifyingQuery
protected boolean isModifyingQuery()Description copied from class:AbstractCassandraQueryReturns whether the query is a modifying query.- Specified by:
isModifyingQueryin classAbstractCassandraQuery- Returns:
- a boolean value indicating whether the query is a modifying query.
-