Class CassandraQueryMethod
java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.cassandra.repository.query.CassandraQueryMethod
- Direct Known Subclasses:
ReactiveCassandraQueryMethod
Cassandra specific implementation of
QueryMethod
.- Author:
- Matthew Adams, Oliver Gierke, Mark Paluch, John Blum
-
Constructor Summary
ConstructorDescriptionCassandraQueryMethod
(Method method, RepositoryMetadata repositoryMetadata, ProjectionFactory projectionFactory, MappingContext<? extends CassandraPersistentEntity<?>, ? extends CassandraPersistentProperty> mappingContext) Create a newCassandraQueryMethod
from the givenMethod
. -
Method Summary
Modifier and TypeMethodDescriptionprotected Parameters<?,
?> createParameters
(ParametersSource parametersSource) Returns the query string declared in aQuery
annotation or null if neither the annotation found nor the attribute was specified.protected Class<?>
com.datastax.oss.driver.api.core.ConsistencyLevel
Returns theConsistencyLevel
in aQuery
annotation or throwsIllegalStateException
if the annotation was not found.Returns the required query string declared in aQuery
annotation or throwsIllegalStateException
if neither the annotation found nor the attribute was specified.boolean
Returns whether the method has an annotated query.boolean
boolean
void
verify
(Method method, RepositoryMetadata metadata) Validates that this query is not a page query.Methods inherited from class org.springframework.data.repository.query.QueryMethod
createParameters, getName, getNamedQueryName, getResultProcessor, getReturnedObjectType, isCollectionQuery, isModifyingQuery, isPageQuery, isQueryForEntity, isScrollQuery, isSliceQuery, isStreamQuery, toString
-
Constructor Details
-
CassandraQueryMethod
public CassandraQueryMethod(Method method, RepositoryMetadata repositoryMetadata, ProjectionFactory projectionFactory, MappingContext<? extends CassandraPersistentEntity<?>, ? extends CassandraPersistentProperty> mappingContext) Create a newCassandraQueryMethod
from the givenMethod
.- Parameters:
method
- must not be null.repositoryMetadata
- must not be null.projectionFactory
- must not be null.mappingContext
- must not be null.
-
-
Method Details
-
verify
Validates that this query is not a page query. -
getEntityInformation
- Overrides:
getEntityInformation
in classQueryMethod
-
getParameters
- Overrides:
getParameters
in classQueryMethod
-
createParameters
- Overrides:
createParameters
in classQueryMethod
-
hasAnnotatedQuery
public boolean hasAnnotatedQuery()Returns whether the method has an annotated query. -
getAnnotatedQuery
Returns the query string declared in aQuery
annotation or null if neither the annotation found nor the attribute was specified.- Returns:
- the query string or null if no query string present.
-
hasConsistencyLevel
public boolean hasConsistencyLevel()- Returns:
- whether the method has an annotated
ConsistencyLevel
. - Since:
- 2.0
-
getRequiredAnnotatedConsistencyLevel
public com.datastax.oss.driver.api.core.ConsistencyLevel getRequiredAnnotatedConsistencyLevel() throws IllegalStateExceptionReturns theConsistencyLevel
in aQuery
annotation or throwsIllegalStateException
if the annotation was not found.- Returns:
- the
ConsistencyLevel
. - Throws:
IllegalStateException
- if the required annotation was not found.
-
getRequiredAnnotatedQuery
Returns the required query string declared in aQuery
annotation or throwsIllegalStateException
if neither the annotation found nor the attribute was specified.- Returns:
- the query string.
- Throws:
IllegalStateException
- in case query method has no annotated query.
-
getDomainClass
- Overrides:
getDomainClass
in classQueryMethod
-
getReturnType
- Returns:
- the return type for this
QueryMethod
.
-
isResultSetQuery
public boolean isResultSetQuery()- Returns:
- true if the method returns a
ResultSet
.
-