Spring Data Document

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

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

public abstract class QueryUtils
extends Object

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

Author:
Oliver Gierke

Method Summary
static Query applyPagination(Query query, org.springframework.data.domain.Pageable pageable)
          Applies the given Pageable to the given Query.
static Query applySorting(Query query, org.springframework.data.domain.Sort sort)
          Applies the given Sort to the Query.
static Order toOrder(org.springframework.data.domain.Sort.Order order)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

applyPagination

public static Query applyPagination(Query query,
                                    org.springframework.data.domain.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,
                                 org.springframework.data.domain.Sort sort)
Applies the given Sort to the Query. Will do nothing if Sort is null.

Parameters:
query -
sort -
Returns:

toOrder

public static Order toOrder(org.springframework.data.domain.Sort.Order order)

Spring Data Document

Copyright © 2012. All Rights Reserved.