Class AbstractN1qlBasedQuery
java.lang.Object
org.springframework.data.couchbase.repository.query.AbstractN1qlBasedQuery
- All Implemented Interfaces:
RepositoryQuery
- Direct Known Subclasses:
PartTreeN1qlBasedQuery
Abstract base for all Couchbase
RepositoryQuery
. It is in charge of inspecting the parameters and choosing
the correct N1QLQuery
implementation to use.- Author:
- Simon Baslé, Subhashni Balakrishnan, Mark Paluch, Johannes Jasper
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractN1qlBasedQuery
(CouchbaseQueryMethod queryMethod, CouchbaseOperations couchbaseOperations) -
Method Summary
Modifier and TypeMethodDescriptionprotected static N1QLQuery
buildQuery
(N1QLExpression expression, com.couchbase.client.java.json.JsonValue queryPlaceholderValues, com.couchbase.client.java.query.QueryScanConsistency scanConsistency) protected List<?>
executeCollection
(N1QLQuery query, Class<?> typeToRead) protected Object
executeDependingOnType
(N1QLQuery query, N1QLQuery countQuery, QueryMethod queryMethod, Pageable pageable, Class<?> typeToRead) protected Object
executeEntity
(N1QLQuery query, Class<?> typeToRead) protected Object
executePaged
(N1QLQuery query, N1QLQuery countQuery, Pageable pageable, Class<?> typeToRead) protected Object
executeSingleProjection
(N1QLQuery query) protected Object
executeSliced
(N1QLQuery query, N1QLQuery countQuery, Pageable pageable, Class<?> typeToRead) protected Object
executeStream
(N1QLQuery query, Class<?> typeToRead) protected CouchbaseOperations
protected abstract N1QLExpression
getCount
(ParameterAccessor accessor, Object[] runtimeParameters) The statement for a count() query.protected abstract N1QLExpression
getExpression
(ParameterAccessor accessor, Object[] runtimeParameters, ReturnedType returnedType) protected abstract com.couchbase.client.java.json.JsonValue
getPlaceholderValues
(ParameterAccessor accessor) protected com.couchbase.client.java.query.QueryScanConsistency
protected abstract boolean
-
Field Details
-
queryMethod
-
-
Constructor Details
-
AbstractN1qlBasedQuery
protected AbstractN1qlBasedQuery(CouchbaseQueryMethod queryMethod, CouchbaseOperations couchbaseOperations)
-
-
Method Details
-
buildQuery
protected static N1QLQuery buildQuery(N1QLExpression expression, com.couchbase.client.java.json.JsonValue queryPlaceholderValues, com.couchbase.client.java.query.QueryScanConsistency scanConsistency) -
getCount
The statement for a count() query. This must aggregate using count with the aliasCountFragment.COUNT_ALIAS
.- See Also:
-
useGeneratedCountQuery
protected abstract boolean useGeneratedCountQuery()- Returns:
- true if the
count statement
should also be used when the return type of the QueryMethod is a primitive type.
-
getExpression
protected abstract N1QLExpression getExpression(ParameterAccessor accessor, Object[] runtimeParameters, ReturnedType returnedType) -
getPlaceholderValues
protected abstract com.couchbase.client.java.json.JsonValue getPlaceholderValues(ParameterAccessor accessor) -
getScanConsistency
protected com.couchbase.client.java.query.QueryScanConsistency getScanConsistency() -
execute
- Specified by:
execute
in interfaceRepositoryQuery
-
executeDependingOnType
-
executeCollection
-
executeEntity
-
executeStream
-
executePaged
-
executeSliced
-
executeSingleProjection
-
getQueryMethod
- Specified by:
getQueryMethod
in interfaceRepositoryQuery
-
getCouchbaseOperations
-