Class SpringDataCouchbaseQuery<T>

java.lang.Object
com.querydsl.couchbase.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
  • Constructor Details

    • SpringDataCouchbaseQuery

      public SpringDataCouchbaseQuery(CouchbaseOperations operations, Class<? extends T> type)
      Parameters:
      operations - must not be null.
      type - must not be null.
    • SpringDataCouchbaseQuery

      public SpringDataCouchbaseQuery(CouchbaseOperations operations, Class<? extends T> type, String collectionName)
      Creates a new SpringDataCouchbaseQuery 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

      public com.mysema.commons.lang.CloseableIterator<T> iterate()
      Specified by:
      iterate in interface com.querydsl.core.Fetchable<T>
    • stream

      public Stream<T> stream()
      Specified by:
      stream in interface com.querydsl.core.Fetchable<T>
    • fetch

      public List<T> fetch()
      Specified by:
      fetch in interface com.querydsl.core.Fetchable<T>
    • fetchPage

      public Page<T> fetchPage(Pageable pageable)
      Fetch a Page.
      Parameters:
      pageable -
      Returns:
    • fetchFirst

      public T fetchFirst()
      Specified by:
      fetchFirst in interface com.querydsl.core.Fetchable<T>
    • fetchOne

      public T fetchOne()
      Specified by:
      fetchOne in interface com.querydsl.core.Fetchable<T>
    • fetchResults

      public com.querydsl.core.QueryResults<T> fetchResults()
      Specified by:
      fetchResults in interface com.querydsl.core.Fetchable<T>
    • fetchCount

      public long fetchCount()
      Specified by:
      fetchCount in interface com.querydsl.core.Fetchable<T>
    • createQuery

      protected Query createQuery()
    • createFilter

      protected com.querydsl.core.types.Predicate createFilter(com.querydsl.core.QueryMetadata metadata)
      Overrides:
      createFilter in class AbstractCouchbaseQueryDSL<SpringDataCouchbaseQuery<T>>
    • getIds

      protected List<Object> getIds(Class<?> var1, com.querydsl.core.types.Predicate var2)
      Specified by:
      getIds in class AbstractCouchbaseQueryDSL<SpringDataCouchbaseQuery<T>>
    • createQuery

      protected Query createQuery(@Nullable com.querydsl.core.types.Predicate filter, @Nullable com.querydsl.core.types.Expression<?> projection, com.querydsl.core.QueryModifiers modifiers, List<com.querydsl.core.types.OrderSpecifier<?>> orderBy)
    • toString

      public String toString()
      Returns the representation of the query.
      The following query
      
       where(p.lastname.eq("Matthews")).orderBy(p.firstname.asc()).offset(1).limit(5);
       
      results in
      
       find({"lastname" : "Matthews"}).sort({"firstname" : 1}).skip(1).limit(5)
       
      Note that encoding to String may fail when using data types that cannot be encoded or DBRef's without an identifier.
      Overrides:
      toString in class AbstractCouchbaseQueryDSL<Q extends org.springframework.data.couchbase.repository.support.SpringDataCouchbaseQuerySupport<Q>>
      Returns:
      never null.
    • asDocument

      public CouchbaseDocument asDocument()
      Get the where definition as a Document instance
      Overrides:
      asDocument in class AbstractCouchbaseQueryDSL<Q extends org.springframework.data.couchbase.repository.support.SpringDataCouchbaseQuerySupport<Q>>
      Returns:
    • createSort

      protected Sort createSort(List<com.querydsl.core.types.OrderSpecifier<?>> orderSpecifiers)
      Compute the sort CouchbaseDocument from the given list of order specifiers.
      Parameters:
      orderSpecifiers - can be null.
      Returns:
      an empty CouchbaseDocument if predicate is null. see CouchbaseDocumentSerializer#toSort(List)