|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.mongodb.core.query.Query
public class Query
| Constructor Summary | |
|---|---|
Query()
|
|
Query(Criteria criteria)
Creates a new Query using the given Criteria. |
|
| Method Summary | |
|---|---|
Query |
addCriteria(Criteria criteria)
Adds the given Criteria to the current Query. |
boolean |
equals(Object obj)
|
Field |
fields()
|
protected List<Criteria> |
getCriteria()
|
com.mongodb.DBObject |
getFieldsObject()
|
String |
getHint()
|
int |
getLimit()
|
com.mongodb.DBObject |
getQueryObject()
|
Set<Class<?>> |
getRestrictedTypes()
|
int |
getSkip()
|
com.mongodb.DBObject |
getSortObject()
|
int |
hashCode()
|
static boolean |
isRestrictedTypeKey(String key)
Deprecated. don't call this method as the restricted type handling will undergo some significant changes going forward. |
Query |
limit(int limit)
|
static Query |
query(Criteria criteria)
Static factory method to create a Query using the provided Criteria. |
Query |
restrict(Class<?> type,
Class<?>... additionalTypes)
Restricts the query to only return documents instances that are exactly of the given types. |
Query |
skip(int skip)
|
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 |
|---|
public Query()
public Query(Criteria criteria)
Query using the given Criteria.
criteria - must not be null.| Method Detail |
|---|
public static Query query(Criteria criteria)
Query using the provided Criteria.
criteria - must not be null.
public Query addCriteria(Criteria criteria)
Criteria to the current Query.
criteria - must not be null.
public Field fields()
public Query skip(int skip)
public Query limit(int limit)
public Query withHint(String name)
name - must not be null or empty.
public Query with(Pageable pageable)
Query instance. Will transparently set skip and
limit as well as applying the Sort instance defined with the Pageable.
pageable -
public Query with(Sort sort)
Sort to the Query instance.
sort -
public Set<Class<?>> getRestrictedTypes()
public Query restrict(Class<?> type,
Class<?>... additionalTypes)
type - may not be nulladditionalTypes - may not be null
public com.mongodb.DBObject getQueryObject()
public com.mongodb.DBObject getFieldsObject()
public com.mongodb.DBObject getSortObject()
public int getSkip()
public int getLimit()
public String getHint()
protected List<Criteria> getCriteria()
public String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object@Deprecated public static boolean isRestrictedTypeKey(String key)
key -
|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||