Class StringQuery
java.lang.Object
org.springframework.data.couchbase.core.query.Query
org.springframework.data.couchbase.core.query.StringQuery
Query created from the string in @Query annotation in the repository interface.
@Query("#{#n1ql.selectEntity} where #{#n1ql.filter} and firstname = $1 and lastname = $2") List<User> getByFirstnameAndLastname(String firstname, String lastname);It must include the SELECT ... FROM ... preferably via the #n1ql expression, in addition to any predicates required, including the n1ql.filter (for _class = className)
- Author:
- Michael Reiche
-
Field Summary
-
Constructor Summary
ConstructorDescriptionStringQuery
(CouchbaseQueryMethod queryMethod, String n1qlString, QueryMethodEvaluationContextProvider queryMethodEvaluationContextProvider, ParameterAccessor parameterAccessor, SpelExpressionParser spelExpressionParser) -
Method Summary
Modifier and TypeMethodDescriptiontoN1qlRemoveString
(CouchbaseConverter converter, String bucketName, String scopeName, String collectionName, Class domainClass) toN1qlRemoveString - use toN1qlSelectStringtoN1qlSelectString
(CouchbaseConverter converter, String bucketName, String scope, String collection, Class domainClass, Class resultClass, boolean isCount, String[] distinctFields, String[] fields) Methods inherited from class org.springframework.data.couchbase.core.query.Query
addCriteria, appendSkipAndLimit, appendSort, appendString, appendWhere, appendWhereString, buildQueryOptions, distinct, distinct, equals, export, getCriteriaList, getDistinctFields, getMeta, getN1qlSpelValues, getScanConsistency, isDistinct, limit, query, scanConsistency, setMeta, setNamedParameters, setPositionalParameters, skip, toN1qlSelectString, with, with, withoutSort
-
Constructor Details
-
StringQuery
public StringQuery(CouchbaseQueryMethod queryMethod, String n1qlString, QueryMethodEvaluationContextProvider queryMethodEvaluationContextProvider, ParameterAccessor parameterAccessor, SpelExpressionParser spelExpressionParser)
-
-
Method Details
-
toN1qlSelectString
public String toN1qlSelectString(CouchbaseConverter converter, String bucketName, String scope, String collection, Class domainClass, Class resultClass, boolean isCount, String[] distinctFields, String[] fields) - Overrides:
toN1qlSelectString
in classQuery
-
toN1qlRemoveString
public String toN1qlRemoveString(CouchbaseConverter converter, String bucketName, String scopeName, String collectionName, Class domainClass) toN1qlRemoveString - use toN1qlSelectString- Overrides:
toN1qlRemoveString
in classQuery
- Parameters:
converter
-bucketName
-scopeName
-collectionName
-domainClass
-
-