Class Query
java.lang.Object
org.springframework.data.couchbase.core.query.Query
- Direct Known Subclasses:
BasicQuery
,N1QLQuery
,StringQuery
- Author:
- Michael Nitschinger, Michael Reiche
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCriteria
(QueryCriteriaDefinition criteriaDefinition) void
void
void
appendString
(StringBuilder sb, String whereString) void
appendWhere
(StringBuilder sb, int[] paramIndexPtr, CouchbaseConverter converter) void
appendWhereString
(StringBuilder sb, String whereString) com.couchbase.client.java.query.QueryOptions
buildQueryOptions
(com.couchbase.client.java.query.QueryOptions options, com.couchbase.client.java.query.QueryScanConsistency scanConsistency) build QueryOptions from parameters and scanConsistencydistinct
(boolean distinct) Is this a DISTINCT query?distinctFields for query (non-null but empty means all fields) ?boolean
export
(int[]... paramIndexPtrHolder) protected List<QueryCriteriaDefinition>
String[]
distinctFields for query (non-null but empty means all fields) ?getMeta()
getN1qlSpelValues
(CouchbaseConverter converter, String bucketName, String scopeName, String collectionName, Class domainClass, Class returnClass, boolean isCount, String[] distinctFields, String[] fields) com.couchbase.client.java.query.QueryScanConsistency
queryScanConsistencyboolean
Is this a DISTINCT query?boolean
limit
(int limit) Limit the number of returned documents tolimit
.static Query
query
(QueryCriteriaDefinition criteriaDefinition) scanConsistency
(com.couchbase.client.java.query.QueryScanConsistency queryScanConsistency) Sets the given scan consistency on theQuery
instance.void
setMeta
(CouchbaseQueryMethod method, Class<?> typeToRead) this collections annotations from the method, repository class and possibly the entity class to be used as options.setNamedParameters
(com.couchbase.client.java.json.JsonObject parameters) set the named parameters on the query object There can only be named parameters or positional parameters - not both.setPositionalParameters
(com.couchbase.client.java.json.JsonArray parameters) set the postional parameters on the query object There can only be named parameters or positional parameters - not both.skip
(long skip) Set number of documents to skip before returning results.toN1qlRemoveString
(CouchbaseConverter converter, String bucketName, String scopeName, String collectionName, Class domainClass) toN1qlSelectString
(CouchbaseConverter converter, String bucketName, String scopeName, String collectionName, Class domainClass, Class returnClass, boolean isCount, String[] distinctFields, String[] fields) toN1qlSelectString
(ReactiveCouchbaseTemplate template, Class domainClass, boolean isCount) Deprecated.Sets the given pagination information on theQuery
instance.
-
Field Details
-
sort
-
-
Constructor Details
-
Query
public Query() -
Query
-
Query
-
-
Method Details
-
query
-
addCriteria
-
getCriteriaList
-
setPositionalParameters
set the postional parameters on the query object There can only be named parameters or positional parameters - not both.- Parameters:
parameters
- - the positional parameters- Returns:
- - the query
-
setNamedParameters
set the named parameters on the query object There can only be named parameters or positional parameters - not both.- Parameters:
parameters
- - the named parameters- Returns:
- - the query
-
skip
Set number of documents to skip before returning results.- Parameters:
skip
-- Returns:
-
limit
Limit the number of returned documents tolimit
.- Parameters:
limit
-- Returns:
-
distinct
Is this a DISTINCT query?distinct
.- Parameters:
distinct
-- Returns:
-
isDistinct
public boolean isDistinct()Is this a DISTINCT query?distinct
.- Returns:
- distinct
-
distinct
distinctFields for query (non-null but empty means all fields) ?distinctFields
.- Parameters:
distinctFields
-- Returns:
-
getDistinctFields
distinctFields for query (non-null but empty means all fields) ?distinctFields
.- Returns:
- distinctFields
-
with
Sets the given pagination information on theQuery
instance. Will transparently setskip
andlimit
as well as applying theSort
instance defined with thePageable
.- Parameters:
pageable
-- Returns:
-
getScanConsistency
public com.couchbase.client.java.query.QueryScanConsistency getScanConsistency()queryScanConsistency- Returns:
- queryScanConsistency
-
scanConsistency
public Query scanConsistency(com.couchbase.client.java.query.QueryScanConsistency queryScanConsistency) Sets the given scan consistency on theQuery
instance.- Parameters:
queryScanConsistency
-- Returns:
- this
-
with
- Parameters:
sort
-- Returns:
-
withoutSort
-
appendSkipAndLimit
-
appendSort
-
appendWhere
-
appendWhereString
-
appendString
-
export
-
toN1qlSelectString
@Deprecated public String toN1qlSelectString(ReactiveCouchbaseTemplate template, Class domainClass, boolean isCount) Deprecated. -
toN1qlSelectString
-
toN1qlRemoveString
-
getN1qlSpelValues
public static StringBasedN1qlQueryParser.N1qlSpelValues getN1qlSpelValues(CouchbaseConverter converter, String bucketName, String scopeName, String collectionName, Class domainClass, Class returnClass, boolean isCount, String[] distinctFields, String[] fields) -
buildQueryOptions
public com.couchbase.client.java.query.QueryOptions buildQueryOptions(com.couchbase.client.java.query.QueryOptions options, com.couchbase.client.java.query.QueryScanConsistency scanConsistency) build QueryOptions from parameters and scanConsistency- Parameters:
scanConsistency
-- Returns:
- QueryOptions
-
setMeta
this collections annotations from the method, repository class and possibly the entity class to be used as options. This will find annotations included in composed annotations as well. Ideally- Parameters:
method
- representing the query.
-
getMeta
-
isReadonly
public boolean isReadonly() -
equals
-