|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.leanengine.LeanQuery
public class LeanQuery
Class to perform data queries against server datastore.
| Nested Class Summary | |
|---|---|
static class |
LeanQuery.FilterOperator
FilterOperator specifies what type of operation you want to apply to your filter. |
static class |
LeanQuery.SortDirection
SortDirection controls the order of a sort. |
| Constructor Summary | |
|---|---|
LeanQuery(java.lang.String kind)
Constructor to initialize query. |
|
| Method Summary | |
|---|---|
LeanQuery |
addFilter(java.lang.String property,
LeanQuery.FilterOperator operator,
java.lang.Object value)
Adds a filter on the specified property. |
LeanQuery |
addSort(java.lang.String property,
LeanQuery.SortDirection direction)
Adds a sort on the specified property. |
LeanEntity[] |
fetch()
Executes the query and fetches the initial data set. |
void |
fetchInBackground(NetworkCallback<LeanEntity> callback)
Executes the query and fetches the initial data set. |
LeanEntity[] |
fetchNext()
Executes the query and fetches the next data set. |
void |
fetchNextInBackground(NetworkCallback<LeanEntity> callback)
Executes the query and fetches the next data set. |
java.util.List<QueryFilter> |
getFilters()
Returns a list of QueryFilters set on this query. |
java.lang.String |
getKind()
Returns the kind (name) of entities this query is fetching. |
int |
getLimit()
Returns the limit set on this query - the size of result set to return when fetching. |
int |
getOffset()
Returns the offset set on this query - the number of results to skip before returning any results. |
java.util.List<QuerySort> |
getSorts()
Returns a list of QuerySorts set on this query. |
LeanQuery |
limit(int limit)
The size of result set returned by this query's fetch methods. |
LeanQuery |
offset(int offset)
Sets the offset - the number of results to skip before returning any results. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LeanQuery(java.lang.String kind)
kind - The kind (name) of entities to search for.| Method Detail |
|---|
public void fetchInBackground(NetworkCallback<LeanEntity> callback)
limit(int) and offset(int) called on this query.
The defaults are: limit = 20 and offset = 0 as defined by the Google AppEngine.
fetchNextInBackground(NetworkCallback) or fetchNext().
callback - NetworkCallback that will be invoked when background task is done.
public void fetchNextInBackground(NetworkCallback<LeanEntity> callback)
throws java.lang.IllegalStateException
fetch() or fetchInBackground(NetworkCallback) are invoked.
fetch() and fetchNext() methods.
callback - NetworkCallback that will be invoked when background task is done.
java.lang.IllegalStateException - If called before fetch() or fetchInBackground(NetworkCallback).
public LeanEntity[] fetch()
throws LeanException
limit(int) and offset(int) called on this query.
The defaults are: limit = 20 and offset = 0 as defined by the Google AppEngine.
fetchNext() or fetchNextInBackground(NetworkCallback).
LeanException - In case of errors a LeanException is thrown.
java.lang.IllegalStateException - If called before fetch() or fetchInBackground(NetworkCallback).
public LeanEntity[] fetchNext()
throws LeanException
fetch() or fetchInBackground(NetworkCallback) are invoked.
fetch() and fetchNext() methods.
LeanException - In case of errors a LeanException is thrown.
java.lang.IllegalStateException - If called before fetch() or fetchInBackground(NetworkCallback).
public LeanQuery addFilter(java.lang.String property,
LeanQuery.FilterOperator operator,
java.lang.Object value)
property - The name of the property to which the filter applies.operator - A LeanQuery.FilterOperator to use.value - An instance of a supported datastore type.
this (for chaining)
public LeanQuery addSort(java.lang.String property,
LeanQuery.SortDirection direction)
property - The name of the property to which the sort applies.direction - A LeanQuery.SortDirection to use.
this (for chaining)public java.lang.String getKind()
public java.util.List<QuerySort> getSorts()
List<QuerySort>public java.util.List<QueryFilter> getFilters()
List<QueryFilter>public LeanQuery limit(int limit)
limit - The size of result set.
this (for chaining)public int getLimit()
limit(int)
public int getOffset()
offset(int)
public LeanQuery offset(int offset)
offset - The number of results to skip before returning the result set.
this (for chaining)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||