Spring Data MongoDB

org.springframework.data.mongodb.core.query
Class Query

java.lang.Object
  extended by org.springframework.data.mongodb.core.query.Query
Direct Known Subclasses:
BasicQuery

public class Query
extends Object

Author:
Thomas Risberg, Oliver Gierke

Constructor Summary
Query()
           
Query(Criteria criteria)
           
 
Method Summary
 Query addCriteria(Criteria criteria)
           
 boolean equals(Object obj)
           
 Field fields()
           
protected  List<Criteria> getCriteria()
           
 com.mongodb.DBObject getFieldsObject()
           
 String getHint()
           
 int getLimit()
           
 com.mongodb.DBObject getQueryObject()
           
 int getSkip()
           
 com.mongodb.DBObject getSortObject()
           
 int hashCode()
           
 Query limit(int limit)
           
static Query query(Criteria critera)
          Static factory method to create a Query using the provided criteria
 Query skip(int skip)
           
 Sort sort()
          Deprecated. use with(Sort) instead
 String toString()
           
 Query with(Pageable pageable)
          Sets the given pagination information on the Query instance.
 Query with(Sort sort)
          Adds a Sort to the Query instance.
 Query withHint(String name)
          Configures the query to use the given hint when being executed.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Query

public Query()

Query

public Query(Criteria criteria)
Method Detail

query

public static Query query(Criteria critera)
Static factory method to create a Query using the provided criteria

Parameters:
critera -
Returns:

addCriteria

public Query addCriteria(Criteria criteria)

fields

public Field fields()

skip

public Query skip(int skip)

limit

public Query limit(int limit)

withHint

public Query withHint(String name)
Configures the query to use the given hint when being executed.

Parameters:
name - must not be null or empty.
Returns:

sort

@Deprecated
public Sort sort()
Deprecated. use with(Sort) instead

Returns a Sort instance to define ordering properties.

Returns:

with

public Query with(Pageable pageable)
Sets the given pagination information on the Query instance. Will transparently set skip and limit as well as applying the Sort instance defined with the Pageable.

Parameters:
pageable -
Returns:

with

public Query with(Sort sort)
Adds a Sort to the Query instance.

Parameters:
sort -
Returns:

getQueryObject

public com.mongodb.DBObject getQueryObject()

getFieldsObject

public com.mongodb.DBObject getFieldsObject()

getSortObject

public com.mongodb.DBObject getSortObject()

getSkip

public int getSkip()

getLimit

public int getLimit()

getHint

public String getHint()

getCriteria

protected List<Criteria> getCriteria()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

Spring Data MongoDB

Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.