public final class MobileServiceJsonTable extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TABLES_URL
Tables URI part
|
Constructor and Description |
---|
MobileServiceJsonTable(String name,
MobileServiceClient client)
Constructor for MobileServiceJsonTable
|
Modifier and Type | Method and Description |
---|---|
void |
delete(Object elementOrId,
List<
Deletes an entity from a Mobile Service Table using a given id
|
void |
delete(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
|
EnumSet<MobileServiceSystemProperty> |
getSystemProperties() |
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,
List<
Inserts a JsonObject into a Mobile Service Table
|
void |
insert(com.google.gson.JsonObject element,
TableJsonOperationCallback callback)
Inserts a JsonObject into a Mobile Service table
|
void |
lookUp(Object id,
List<
Looks up a row in the table and retrieves its JSON value.
|
void |
lookUp(Object id,
TableJsonOperationCallback callback)
Looks up a row in the table and retrieves its JSON value.
|
MobileServiceQuery<E> |
orderBy(String field,
QueryOrder order)
Creates a query with the specified order
|
MobileServiceQuery<E> |
parameter(String parameter,
String value)
Adds a new user-defined parameter to the query
|
MobileServiceQuery<E> |
select(String... fields)
Specifies the fields to retrieve
|
void |
setSystemProperties(EnumSet<MobileServiceSystemProperty> systemProperties) |
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,
List<
Updates an element from a Mobile Service Table
|
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 String TABLES_URL
public MobileServiceJsonTable(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 lookUp(Object id, TableJsonOperationCallback callback)
id
- The id of the rowcallback
- Callback to invoke after the operation is completedpublic void lookUp(Object id, List<> parameters, TableJsonOperationCallback callback)
id
- The id of the rowparameters
- A list of user-defined parameters and values to include in the request URI query stringcallback
- Callback to invoke after the operation is completedpublic void insert(com.google.gson.JsonObject element, TableJsonOperationCallback callback)
element
- The JsonObject to insertcallback
- Callback to invoke when the operation is completedIllegalArgumentException
- if the element has an id property set with a numeric value other than default (0), or an invalid string valuepublic void insert(com.google.gson.JsonObject element, List<> parameters, TableJsonOperationCallback callback)
element
- The JsonObject to insertparameters
- A list of user-defined parameters and values to include in the request URI query stringcallback
- Callback to invoke when the operation is completedIllegalArgumentException
- if the element has an id property set with a numeric value other than default (0), or an invalid string valuepublic void update(com.google.gson.JsonObject element, TableJsonOperationCallback callback)
element
- The JsonObject to updatecallback
- Callback to invoke when the operation is completedpublic void update(com.google.gson.JsonObject element, List<> parameters, TableJsonOperationCallback callback)
element
- The JsonObject to updateparameters
- A list of user-defined parameters and values to include in the request URI query stringcallback
- Callback to invoke when the operation is completedpublic void execute(E callback)
callback
- Callback to invoke when the operation is completedpublic String getTableName()
public EnumSet<MobileServiceSystemProperty> getSystemProperties()
public void setSystemProperties(EnumSet<MobileServiceSystemProperty> systemProperties)
public MobileServiceQuery<E> parameter(String parameter, String value)
parameter
- The parameter namevalue
- The parameter valuepublic MobileServiceQuery<E> orderBy(String field, QueryOrder order)
field
- Field nameorder
- Sorting orderpublic MobileServiceQuery<E> top(int top)
top
- Number of records to returnpublic MobileServiceQuery<E> skip(int skip)
skip
- public MobileServiceQuery<E> select(String... fields)
fields
- Names of the fields to retrievepublic MobileServiceQuery<E> includeInlineCount()
public MobileServiceQuery<E> where()
public MobileServiceQuery<E> where(MobileServiceQuery<?> query)
query
- The existing filterpublic void delete(Object element, TableDeleteCallback callback)
element
- The entity to deletecallback
- Callback to invoke when the operation is completedpublic void delete(Object elementOrId, List<> parameters, TableDeleteCallback callback)
id
- The id of the entity to deleteparameters
- A list of user-defined parameters and values to include in the request URI query stringcallback
- Callback to invoke when the operation is completed