public class NCMBQuery<T extends NCMBBase>
extends java.lang.Object
Constructor and Description |
---|
NCMBQuery(java.lang.String className)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addOrderByAscending(java.lang.String key)
add Order by ascending with specified key
Search Results is sorted in order which key was added.
|
void |
addOrderByDescending(java.lang.String key)
add Order by descending with specified key
|
int |
count()
return the number of search results
|
void |
countInBackground(CountCallback callback)
return number of search results asynchronously
|
void |
deleteOrder(java.lang.String key)
remove the specified key sort conditions
|
java.util.List<T> |
find()
search data from NIFCLOUD mobile backend
|
void |
findInBackground(FindCallback<T> callback)
search data from NIFCLOUD mobile backend asynchronously
|
org.json.JSONObject |
getConditions()
get current search condition
|
void |
or(java.util.Collection<NCMBQuery> queries)
set the conditions to search the data that matches any one of the given query
all queries must be same class name
|
void |
setIncludeKey(java.lang.String key)
set to include nested Object of the specified key in the search results
|
void |
setLimit(int number)
set the number of acquisition of search results
|
void |
setSkip(int number)
set the number to skip the search results
|
void |
whereContainedIn(java.lang.String key,
java.util.Collection<? extends java.lang.Object> objects)
set the conditions to search the data that contains value of the specified key
|
void |
whereContainedInArray(java.lang.String key,
java.util.Collection<? extends java.lang.Object> elements)
set the conditions to search the data that contains elements of array in the specified key
|
void |
whereContainsAll(java.lang.String key,
java.util.Collection<? extends java.lang.Object> elements)
set the conditions to search the data that contains all elements of array in the specified key
|
void |
whereDoesNotExists(java.lang.String key)
set the conditions to search the data that specified key exists
|
void |
whereEqualTo(java.lang.String key,
java.lang.Object value)
set the conditions to search the data that matches the value of the specified key
|
void |
whereExists(java.lang.String key)
set the conditions to search the data that specified key exists
|
void |
whereGreaterThan(java.lang.String key,
java.lang.Object value)
set the conditions to search the data that greater than the value of the specified key
|
void |
whereGreaterThanOrEqualTo(java.lang.String key,
java.lang.Object value)
set the conditions to search the data that greater than or equal to the value of the specified key
|
void |
whereLessThan(java.lang.String key,
java.lang.Object value)
set the conditions to search the data that less than the value of the specified key
|
void |
whereLessThanOrEqualTo(java.lang.String key,
java.lang.Object value)
set the conditions to search the data that less than or equal to the value of the specified key
|
void |
whereMatchesKeyInQuery(java.lang.String key,
java.lang.String inQueryKey,
NCMBQuery inQuery)
set the conditions to search the data that matches inQuery condition and inQueryKey value of the specified key
|
void |
whereMatchesQuery(java.lang.String key,
NCMBQuery inQuery)
set the conditions to search the data that has pointer that match inQuery condition object
|
void |
whereNotContainedIn(java.lang.String key,
java.util.Collection<? extends java.lang.Object> objects)
set the conditions to search the data that not contains value of the specified key
|
void |
whereNotContainedInArray(java.lang.String key,
java.util.Collection<? extends java.lang.Object> elements)
set the conditions to search the data that contains elements of array in the specified key
|
void |
whereNotEqualTo(java.lang.String key,
java.lang.Object value)
set the conditions to search the data that not matches the value of the specified key
|
void |
whereRelatedTo(NCMBObject parent,
java.lang.String key)
set the conditions to search the data that related parent object in specified key
|
void |
whereWithinGeoBox(java.lang.String key,
android.location.Location southwest,
android.location.Location northeast)
set the conditions to search the data with location information
|
void |
whereWithinKilometers(java.lang.String key,
android.location.Location center,
double distance)
set the conditions to search the data with location information
|
void |
whereWithinMiles(java.lang.String key,
android.location.Location center,
int distance)
set the conditions to search the data with location information
|
void |
whereWithinRadians(java.lang.String key,
android.location.Location center,
int distance)
set the conditions to search the data with location information
|
public NCMBQuery(java.lang.String className)
className
- class name string for search datapublic java.util.List<T> find() throws NCMBException
NCMBException
- exception from NIFCLOUD mobile backendpublic void findInBackground(FindCallback<T> callback)
callback
- executed callback after data searchpublic org.json.JSONObject getConditions()
public void whereEqualTo(java.lang.String key, java.lang.Object value)
key
- field name to set the conditionsvalue
- condition valuepublic void whereNotEqualTo(java.lang.String key, java.lang.Object value)
key
- field name to set the conditionsvalue
- condition valuepublic void whereLessThan(java.lang.String key, java.lang.Object value)
key
- field name to set the conditionsvalue
- condition valuepublic void whereGreaterThan(java.lang.String key, java.lang.Object value)
key
- field name to set the conditionsvalue
- condition valuepublic void whereLessThanOrEqualTo(java.lang.String key, java.lang.Object value)
key
- field name to set the conditionsvalue
- condition valuepublic void whereGreaterThanOrEqualTo(java.lang.String key, java.lang.Object value)
key
- field name to set the conditionsvalue
- condition valuepublic void whereContainedIn(java.lang.String key, java.util.Collection<? extends java.lang.Object> objects)
key
- field name to set the conditionsobjects
- condition objectspublic void whereNotContainedIn(java.lang.String key, java.util.Collection<? extends java.lang.Object> objects)
key
- field name to set the conditionsobjects
- condition objectspublic void whereExists(java.lang.String key)
key
- field name to set the conditionspublic void whereDoesNotExists(java.lang.String key)
key
- field name to set the conditionspublic void whereContainedInArray(java.lang.String key, java.util.Collection<? extends java.lang.Object> elements)
key
- field name to set the conditionselements
- condition elements in the specified key arraypublic void whereNotContainedInArray(java.lang.String key, java.util.Collection<? extends java.lang.Object> elements)
key
- field name to set the conditionselements
- condition elements in the specified key arraypublic void whereContainsAll(java.lang.String key, java.util.Collection<? extends java.lang.Object> elements)
key
- field name to set the conditionselements
- condition elements in the specified key arraypublic void or(java.util.Collection<NCMBQuery> queries)
queries
- condition queriespublic void whereMatchesKeyInQuery(java.lang.String key, java.lang.String inQueryKey, NCMBQuery inQuery)
key
- field name to set conditionsinQueryKey
- condition field name for inQueryinQuery
- condition for Subquerypublic void whereMatchesQuery(java.lang.String key, NCMBQuery inQuery)
key
- field name that has pointer for inQuery conditionsinQuery
- condition for Subquerypublic void whereRelatedTo(NCMBObject parent, java.lang.String key)
parent
- parent NCMBObject(include subclass)key
- field name that has relation to search class datapublic void whereWithinGeoBox(java.lang.String key, android.location.Location southwest, android.location.Location northeast)
key
- field name that contains location informationsouthwest
- lower left location information for search areanortheast
- Upper right location information for search areapublic void whereWithinKilometers(java.lang.String key, android.location.Location center, double distance)
key
- field name that contains location informationcenter
- center location for data searchingdistance
- search radius distance from center point in kilometerspublic void whereWithinMiles(java.lang.String key, android.location.Location center, int distance)
key
- field name that contains location informationcenter
- center location for data searchingdistance
- search radius distance from center point in milespublic void whereWithinRadians(java.lang.String key, android.location.Location center, int distance)
key
- field name that contains location informationcenter
- center location for data searchingdistance
- search radius distance from center point in radianspublic void setLimit(int number)
number
- number of acquisition (0 ~ 1000)public void setSkip(int number)
number
- number for skippingpublic void setIncludeKey(java.lang.String key)
key
- key with pointer to a nested objectpublic void addOrderByAscending(java.lang.String key)
key
- key for order by ascendingpublic void addOrderByDescending(java.lang.String key)
key
- key for order by descendingpublic void deleteOrder(java.lang.String key)
key
- key for remove sort conditionspublic int count() throws NCMBException
NCMBException
- exception from NIFCLOUD mobile backendpublic void countInBackground(CountCallback callback)
callback
- callback for after object search and count results