public class StringN1qlBasedQuery extends AbstractN1qlBasedQuery
RepositoryQuery for Couchbase, based on N1QL and a String statement.
The statement can contain positional placeholders (eg. name = $1) that will map to the
method's parameters, in the same order.
The statement can also contain SpEL expressions enclosed in #{ and }.
There are couchbase-provided variables included for the bucket namespace,
the ID and CAS fields necessary for entity reconstruction
or a shortcut that covers SELECT AND FROM clauses,
along with a variable for WHERE clause filtering of the correct entity.queryMethod| Constructor and Description |
|---|
StringN1qlBasedQuery(String statement,
CouchbaseQueryMethod queryMethod,
CouchbaseOperations couchbaseOperations,
SpelExpressionParser spelParser,
QueryMethodEvaluationContextProvider evaluationContextProvider) |
| Modifier and Type | Method and Description |
|---|---|
protected com.couchbase.client.java.query.Statement |
getCount(ParameterAccessor accessor,
Object[] runtimeParameters)
The statement for a count() query.
|
protected com.couchbase.client.java.document.json.JsonValue |
getPlaceholderValues(ParameterAccessor accessor) |
com.couchbase.client.java.query.Statement |
getStatement(ParameterAccessor accessor,
Object[] runtimeParameters,
ReturnedType returnedType) |
protected String |
getTypeField() |
protected Class<?> |
getTypeValue() |
protected boolean |
useGeneratedCountQuery() |
buildQuery, execute, executeCollection, executeDependingOnType, executeEntity, executePaged, executeSingleProjection, executeSliced, executeStream, getCouchbaseOperations, getQueryMethodpublic StringN1qlBasedQuery(String statement, CouchbaseQueryMethod queryMethod, CouchbaseOperations couchbaseOperations, SpelExpressionParser spelParser, QueryMethodEvaluationContextProvider evaluationContextProvider)
protected String getTypeField()
protected Class<?> getTypeValue()
protected com.couchbase.client.java.document.json.JsonValue getPlaceholderValues(ParameterAccessor accessor)
getPlaceholderValues in class AbstractN1qlBasedQuerypublic com.couchbase.client.java.query.Statement getStatement(ParameterAccessor accessor, Object[] runtimeParameters, ReturnedType returnedType)
getStatement in class AbstractN1qlBasedQueryprotected com.couchbase.client.java.query.Statement getCount(ParameterAccessor accessor, Object[] runtimeParameters)
AbstractN1qlBasedQueryCountFragment.COUNT_ALIAS.getCount in class AbstractN1qlBasedQueryCountFragmentprotected boolean useGeneratedCountQuery()
useGeneratedCountQuery in class AbstractN1qlBasedQuerycount statement should also be used when
the return type of the QueryMethod is a primitive type.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.