org.springframework.data.document.mongodb.repository
Class QueryUtils

java.lang.Object
  extended by org.springframework.data.document.mongodb.repository.QueryUtils

abstract class QueryUtils
extends java.lang.Object

Collection of utility methods to apply sorting and pagination to a DBCursor.

Author:
Oliver Gierke

Constructor Summary
private QueryUtils()
           
 
Method Summary
static Query applyPagination(Query query, Pageable pageable)
          Applies the given Pageable to the given Query.
static Query applySorting(Query query, Sort sort)
          Applies the given Sort to the Query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryUtils

private QueryUtils()
Method Detail

applyPagination

public static Query applyPagination(Query query,
                                    Pageable pageable)
Applies the given Pageable to the given Query. Will do nothing if Pageable is null.

Parameters:
query -
pageable -
Returns:

applySorting

public static Query applySorting(Query query,
                                 Sort sort)
Applies the given Sort to the Query. Will do nothing if Sort is null.

Parameters:
query -
sort -
Returns: