public final class MobileServiceJsonTable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TABLES_URL
Tables URI part
|
Constructor and Description |
---|
MobileServiceJsonTable(java.lang.String name,
MobileServiceClient client)
Constructor for MobileServiceJsonTable
|
Modifier and Type | Method and Description |
---|---|
void |
delete(int id,
TableDeleteCallback callback)
Deletes an entity from a Mobile Service Table using a given id
|
void |
delete(java.lang.Object element,
TableDeleteCallback callback)
Deletes an entity from a Mobile Service Table
|
void |
execute(E callback)
Executes a query to retrieve all the table rows
|
void |
execute(MobileServiceQuery<?> query,
TableJsonQueryCallback callback)
Retrieves a set of rows from the table using a query
|
java.lang.String |
getTableName()
Returns the name of the represented table
|
MobileServiceQuery<E> |
includeInlineCount()
Include a property with the number of records returned.
|
void |
insert(com.google.gson.JsonObject element,
TableJsonOperationCallback callback)
Inserts a JsonObject into a Mobile Service Table
|
void |
lookUp(java.lang.Object id,
TableJsonOperationCallback callback)
Looks up a row in the table and retrieves its JSON value.
|
MobileServiceQuery<E> |
orderBy(java.lang.String field,
QueryOrder order)
Creates a query with the specified order
|
MobileServiceQuery<E> |
parameter(java.lang.String parameter,
java.lang.String value)
Adds a new user-defined parameter to the query
|
MobileServiceQuery<E> |
select(java.lang.String... fields)
Specifies the fields to retrieve
|
MobileServiceQuery<E> |
skip(int skip)
Sets the number of records to skip over a given number of elements in a
sequence and then return the remainder.
|
MobileServiceQuery<E> |
top(int top)
Sets the number of records to return
|
void |
update(com.google.gson.JsonObject element,
TableJsonOperationCallback callback)
Updates an element from a Mobile Service Table
|
MobileServiceQuery<E> |
where()
Starts a filter to query the table
|
MobileServiceQuery<E> |
where(MobileServiceQuery<?> query)
Starts a filter to query the table with an existing filter
|
public static final java.lang.String TABLES_URL
public MobileServiceJsonTable(java.lang.String name, MobileServiceClient client)
name
- The name of the represented tableclient
- The MobileServiceClient used to invoke table operationspublic void execute(MobileServiceQuery<?> query, TableJsonQueryCallback callback)
query
- The query used to retrieve the rowscallback
- Callback to invoke when the operation is completedpublic void insert(com.google.gson.JsonObject element, TableJsonOperationCallback callback) throws java.security.InvalidParameterException
element
- The JsonObject to insertcallback
- Callback to invoke when the operation is completedjava.security.InvalidParameterException
public void lookUp(java.lang.Object id, TableJsonOperationCallback callback)
id
- The id of the rowcallback
- Callback to invoke after the operation is completedpublic void update(com.google.gson.JsonObject element, TableJsonOperationCallback callback)
element
- The JsonObject to updatecallback
- Callback to invoke when the operation is completedpublic void delete(int id, TableDeleteCallback callback)
id
- The id of the entity to deletecallback
- Callback to invoke when the operation is completedpublic void delete(java.lang.Object element, TableDeleteCallback callback)
element
- The entity to deletecallback
- Callback to invoke when the operation is completedpublic void execute(E callback)
callback
- Callback to invoke when the operation is completedpublic java.lang.String getTableName()
public MobileServiceQuery<E> includeInlineCount()
public MobileServiceQuery<E> orderBy(java.lang.String field, QueryOrder order)
field
- Field nameorder
- Sorting orderpublic MobileServiceQuery<E> parameter(java.lang.String parameter, java.lang.String value)
parameter
- The parameter namevalue
- The parameter valuepublic MobileServiceQuery<E> select(java.lang.String... fields)
fields
- Names of the fields to retrievepublic MobileServiceQuery<E> skip(int skip)
skip
- public MobileServiceQuery<E> top(int top)
top
- Number of records to returnpublic MobileServiceQuery<E> where()
public MobileServiceQuery<E> where(MobileServiceQuery<?> query)
query
- The existing filter