public final class MobileServiceTable<E>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TABLES_URL
Tables URI part
|
Constructor and Description |
---|
MobileServiceTable(java.lang.String name,
MobileServiceClient client,
java.lang.Class<E> clazz)
Constructor for MobileServiceTable
|
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(MobileServiceQuery<?> query,
TableQueryCallback<E> callback) |
void |
execute(TableQueryCallback<E> callback)
Executes a query to retrieve all the table rows
|
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(E element,
TableOperationCallback<E> callback)
Inserts an entity into a Mobile Service Table
|
void |
lookUp(java.lang.Object id,
TableOperationCallback<E> callback)
Looks up a row in the table.
|
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(E element,
TableOperationCallback<E> callback)
Updates an entity 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 MobileServiceTable(java.lang.String name, MobileServiceClient client, java.lang.Class<E> clazz)
name
- The name of the represented tableclient
- The MobileServiceClient used to invoke table operationspublic void execute(MobileServiceQuery<?> query, TableQueryCallback<E> callback)
public void execute(TableQueryCallback<E> callback)
clazz
- The class used to deserialize the rowscallback
- Callback to invoke when the operation is completedpublic void insert(E element, TableOperationCallback<E> callback) throws java.security.InvalidParameterException
element
- The entity to insertcallback
- Callback to invoke when the operation is completedjava.security.InvalidParameterException
public void lookUp(java.lang.Object id, TableOperationCallback<E> callback)
id
- The id of the rowclazz
- The class used to deserialize the rowcallback
- Callback to invoke after the operation is completedpublic void update(E element, TableOperationCallback<E> callback)
element
- The entity 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 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