Class SpringDataCouchbaseQuery<T>
java.lang.Object
org.springframework.data.couchbase.querydsl.document.AbstractCouchbaseQueryDSL<Q>
org.springframework.data.couchbase.repository.support.SpringDataCouchbaseQuery<T>
- All Implemented Interfaces:
com.querydsl.core.Fetchable<T>
,com.querydsl.core.FilteredClause<SpringDataCouchbaseQuery<T>>
,com.querydsl.core.SimpleQuery<SpringDataCouchbaseQuery<T>>
public class SpringDataCouchbaseQuery<T>
extends AbstractCouchbaseQueryDSL<Q>
implements com.querydsl.core.Fetchable<T>
- Author:
- Michael Reiche, Tigran Babloyan
-
Constructor Summary
ConstructorDescriptionSpringDataCouchbaseQuery
(CouchbaseOperations operations, Class<? extends T> type) Creates a newSpringDataCouchbaseQuery
.SpringDataCouchbaseQuery
(CouchbaseOperations operations, Class<? extends T> type, String collectionName) Creates a newSpringDataCouchbaseQuery
to query the given collection. -
Method Summary
Modifier and TypeMethodDescriptionGet the where definition as a Document instanceprotected com.querydsl.core.types.Predicate
createFilter
(com.querydsl.core.QueryMetadata metadata) protected Query
protected Query
createQuery
(com.querydsl.core.types.Predicate filter, com.querydsl.core.types.Expression<?> projection, com.querydsl.core.QueryModifiers modifiers, List<com.querydsl.core.types.OrderSpecifier<?>> orderBy) protected Sort
createSort
(List<com.querydsl.core.types.OrderSpecifier<?>> orderSpecifiers) Compute the sortCouchbaseDocument
from the given list oforder specifiers
.fetch()
long
fetchOne()
Fetch aPage
.com.querydsl.core.QueryResults<T>
com.mysema.commons.lang.CloseableIterator<T>
iterate()
stream()
toString()
Returns the representation of the query.Methods inherited from class org.springframework.data.couchbase.querydsl.document.AbstractCouchbaseQueryDSL
createCriteria, createJoinFilter, createProjection, createQuery, distinct, getQueryMixin, getSerializer, limit, offset, orderBy, orderBy, restrict, set, where, where
-
Constructor Details
-
SpringDataCouchbaseQuery
Creates a newSpringDataCouchbaseQuery
.- Parameters:
operations
- must not be null.type
- must not be null.
-
SpringDataCouchbaseQuery
public SpringDataCouchbaseQuery(CouchbaseOperations operations, Class<? extends T> type, String collectionName) Creates a newSpringDataCouchbaseQuery
to query the given collection.- Parameters:
operations
- must not be null.type
- must not be null.collectionName
- must not be null or empty.
-
-
Method Details
-
iterate
- Specified by:
iterate
in interfacecom.querydsl.core.Fetchable<T>
-
stream
- Specified by:
stream
in interfacecom.querydsl.core.Fetchable<T>
-
fetch
- Specified by:
fetch
in interfacecom.querydsl.core.Fetchable<T>
-
fetchPage
Fetch aPage
.- Parameters:
pageable
-- Returns:
-
fetchFirst
- Specified by:
fetchFirst
in interfacecom.querydsl.core.Fetchable<T>
-
fetchOne
- Specified by:
fetchOne
in interfacecom.querydsl.core.Fetchable<T>
-
fetchResults
- Specified by:
fetchResults
in interfacecom.querydsl.core.Fetchable<T>
-
fetchCount
public long fetchCount()- Specified by:
fetchCount
in interfacecom.querydsl.core.Fetchable<T>
-
createQuery
-
createFilter
protected com.querydsl.core.types.Predicate createFilter(com.querydsl.core.QueryMetadata metadata) - Overrides:
createFilter
in classAbstractCouchbaseQueryDSL<SpringDataCouchbaseQuery<T>>
-
getIds
- Specified by:
getIds
in classAbstractCouchbaseQueryDSL<SpringDataCouchbaseQuery<T>>
-
createQuery
-
toString
Returns the representation of the query.
The following querywhere(p.lastname.eq("Matthews")).orderBy(p.firstname.asc()).offset(1).limit(5);
results infind({"lastname" : "Matthews"}).sort({"firstname" : 1}).skip(1).limit(5)
Note that encoding toString
may fail when using data types that cannot be encoded or DBRef's without an identifier.- Overrides:
toString
in classAbstractCouchbaseQueryDSL<Q extends org.springframework.data.couchbase.repository.support.SpringDataCouchbaseQuerySupport<Q>>
- Returns:
- never null.
-
asDocument
Get the where definition as a Document instance- Overrides:
asDocument
in classAbstractCouchbaseQueryDSL<Q extends org.springframework.data.couchbase.repository.support.SpringDataCouchbaseQuerySupport<Q>>
- Returns:
-
createSort
Compute the sortCouchbaseDocument
from the given list oforder specifiers
.- Parameters:
orderSpecifiers
- can be null.- Returns:
- an empty
CouchbaseDocument
if predicate is null. see CouchbaseDocumentSerializer#toSort(List)
-