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
ConstructorsConstructorDescriptionSpringDataCouchbaseQuery(CouchbaseOperations operations, Class<? extends T> type) Creates a newSpringDataCouchbaseQuery.SpringDataCouchbaseQuery(CouchbaseOperations operations, Class<? extends T> type, String collectionName) Creates a newSpringDataCouchbaseQueryto query the given collection. -
Method Summary
Modifier and TypeMethodDescriptionGet the where definition as a Document instanceprotected com.querydsl.core.types.PredicatecreateFilter(com.querydsl.core.QueryMetadata metadata) protected Queryprotected QuerycreateQuery(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 SortcreateSort(List<com.querydsl.core.types.OrderSpecifier<?>> orderSpecifiers) Compute the sortCouchbaseDocumentfrom the given list oforder specifiers.fetch()longfetchOne()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 newSpringDataCouchbaseQueryto 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:
iteratein interfacecom.querydsl.core.Fetchable<T>
-
stream
- Specified by:
streamin interfacecom.querydsl.core.Fetchable<T>
-
fetch
- Specified by:
fetchin interfacecom.querydsl.core.Fetchable<T>
-
fetchPage
Fetch aPage.- Parameters:
pageable-- Returns:
-
fetchFirst
- Specified by:
fetchFirstin interfacecom.querydsl.core.Fetchable<T>
-
fetchOne
- Specified by:
fetchOnein interfacecom.querydsl.core.Fetchable<T>
-
fetchResults
- Specified by:
fetchResultsin interfacecom.querydsl.core.Fetchable<T>
-
fetchCount
public long fetchCount()- Specified by:
fetchCountin interfacecom.querydsl.core.Fetchable<T>
-
createQuery
-
createFilter
protected com.querydsl.core.types.Predicate createFilter(com.querydsl.core.QueryMetadata metadata) - Overrides:
createFilterin classAbstractCouchbaseQueryDSL<SpringDataCouchbaseQuery<T>>
-
getIds
- Specified by:
getIdsin 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 toStringmay fail when using data types that cannot be encoded or DBRef's without an identifier.- Overrides:
toStringin classAbstractCouchbaseQueryDSL<Q extends org.springframework.data.couchbase.repository.support.SpringDataCouchbaseQuerySupport<Q>>- Returns:
- never null.
-
asDocument
Get the where definition as a Document instance- Overrides:
asDocumentin classAbstractCouchbaseQueryDSL<Q extends org.springframework.data.couchbase.repository.support.SpringDataCouchbaseQuerySupport<Q>>- Returns:
-
createSort
Compute the sortCouchbaseDocumentfrom the given list oforder specifiers.- Parameters:
orderSpecifiers- can be null.- Returns:
- an empty
CouchbaseDocumentif predicate is null. see CouchbaseDocumentSerializer#toSort(List)
-