|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataService
DataService allows you to interact with your data on StackMob
| Method Summary | |
|---|---|
SMObject |
addRelatedObjects(String schema,
SMValue objectId,
String relation,
List<? extends SMValue> relatedIds)
Adds the specified IDs to the specified relationship |
SMObject |
addRelatedObjects(String schema,
SMValue objectId,
String relation,
SMList relatedIds)
Adds the specified IDs to the specified relationship |
long |
countObjects(String schema)
Get the number of objects in a schema |
SMObject |
createObject(String schema,
SMObject toCreate)
Creates a new object in the datastore. |
BulkResult |
createRelatedObjects(String schema,
SMValue objectId,
String relatedField,
List<SMObject> relatedObjectsToCreate)
Creates a number of new objects in the datastore. |
Boolean |
deleteObject(String schema,
SMValue id)
Deletes an object in the datastore. |
Boolean |
deleteObject(String schema,
String id)
Deletes an object in the datastore. |
Set<String> |
getObjectModelNames()
Retrieves a list of the object models declared for the current application. |
List<SMObject> |
readObjects(String schema,
List<SMCondition> conditions)
Reads a list of objects matching the given query fields from the datastore. |
List<SMObject> |
readObjects(String schema,
List<SMCondition> conditions,
int expandDepth)
Reads a list of objects matching the given query fields from the datastore, expanding relationships. |
List<SMObject> |
readObjects(String schema,
List<SMCondition> conditions,
int expandDepth,
ResultFilters resultFilters)
Reads a list of objects matching the given query fields from the datastore subject to several conditions. |
List<SMObject> |
readObjects(String schema,
List<SMCondition> conditions,
List<String> fields)
Reads a list of objects matching the given query fields from the datastore, returning only the specified fields. |
void |
removeRelatedObjects(String schema,
SMValue objectId,
String relation,
List<? extends SMValue> relatedIds,
boolean cascadeDelete)
Removes any number of related objects from a relationship. |
void |
removeRelatedObjects(String schema,
SMValue objectId,
String relation,
SMList relatedIds,
boolean cascadeDelete)
Removes any number of related objects from a relationship. |
SMObject |
updateObject(String schema,
SMValue id,
List<SMCondition> conditions,
List<SMUpdate> updateActions)
Updates an object in the datastore, if and only if it meets additional conditions. |
SMObject |
updateObject(String schema,
SMValue id,
List<SMUpdate> updateActions)
Updates an object in the datastore. |
SMObject |
updateObject(String schema,
String id,
List<SMUpdate> updateActions)
Updates an object in the datastore. |
void |
updateObjects(String schema,
List<SMCondition> conditions,
List<SMUpdate> updateActions)
Updates all objects matching the given query in the datastore |
| Method Detail |
|---|
SMObject createObject(String schema,
SMObject toCreate)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object schematoCreate - the object to create; must match the schema declared for the relevant object type
InvalidSchemaException - if the object to create does not match the relevant schema
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
BulkResult createRelatedObjects(String schema,
SMValue objectId,
String relatedField,
List<SMObject> relatedObjectsToCreate)
throws InvalidSchemaException,
DatastoreException
schema - the name of the schema which contains the relation to the object to be insertedobjectId - the ID value of the object to relate to the inserted objectrelatedField - the field name of the relationshiprelatedObjectsToCreate - the related objects to insert
InvalidSchemaException - if the object to create does not match the relevant schema
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
List<SMObject> readObjects(String schema,
List<SMCondition> conditions)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object modelconditions - the list of conditions which comprise the query
InvalidSchemaException - if the schema specified does not exist, or the query is incompatible with the schema
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
List<SMObject> readObjects(String schema,
List<SMCondition> conditions,
List<String> fields)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object modelconditions - the list of conditions which comprise the queryfields - the list of fields to be returned; regardless of what is specified, the id will always be returned; if null, all fields will be returned
InvalidSchemaException - if the schema specified does not exist, or the query is incompatible with the schema
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
List<SMObject> readObjects(String schema,
List<SMCondition> conditions,
int expandDepth)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object modelconditions - the list of conditions which comprise the queryexpandDepth - the depth to which a query should be expanded
InvalidSchemaException - if the schema specified does not exist, or the query is incompatible with the schema
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
List<SMObject> readObjects(String schema,
List<SMCondition> conditions,
int expandDepth,
ResultFilters resultFilters)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object modelconditions - the list of conditions which comprise the queryexpandDepth - the depth to which a query should be expandedresultFilters - the options to be used when filtering the resultset
InvalidSchemaException - if the schema specified does not exist, or the query is incompatible with the schema
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
SMObject updateObject(String schema,
String id,
List<SMUpdate> updateActions)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationid - the id of the object to updateupdateActions - the actions to take on the object being updated
InvalidSchemaException - if the schema does not exist, or the update actions are incompatible with it
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
SMObject updateObject(String schema,
SMValue id,
List<SMUpdate> updateActions)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationid - the id of the object to updateupdateActions - the actions to take on the object being updated
InvalidSchemaException - if the schema does not exist, or the update actions are incompatible with it
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
SMObject updateObject(String schema,
SMValue id,
List<SMCondition> conditions,
List<SMUpdate> updateActions)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationid - the id of the object to updateconditions - the conditions which must be met for the update to occurupdateActions - the actions to take on the object being updated
InvalidSchemaException - if the schema does not exist, or the update actions are incompatible with it
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
void updateObjects(String schema,
List<SMCondition> conditions,
List<SMUpdate> updateActions)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationquery - the query used to find objects to updateupdateActions - the actions to take on the object being updated
InvalidSchemaException - if the schema does not exist, or the update actions are incompatible with it
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
SMObject addRelatedObjects(String schema,
SMValue objectId,
String relation,
List<? extends SMValue> relatedIds)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationobjectId - the id of the object to which relations should be addedrelation - the relation field to followrelatedIds - the ids of all objects to be related to the specified parent object
InvalidSchemaException - if the schema does not exist, or the update actions are incompatible with it
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
SMObject addRelatedObjects(String schema,
SMValue objectId,
String relation,
SMList relatedIds)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationobjectId - the id of the object to which relations should be addedrelation - the relation field to followrelatedIds - the ids of all objects to be related to the specified parent object
InvalidSchemaException - if the schema does not exist, or the update actions are incompatible with it
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
Boolean deleteObject(String schema,
String id)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationid - the id of the object to delete
InvalidSchemaException - if the object model specified does not exist
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
Boolean deleteObject(String schema,
SMValue id)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationid - the id of the object to delete
InvalidSchemaException - if the object model specified does not exist
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
void removeRelatedObjects(String schema,
SMValue objectId,
String relation,
List<? extends SMValue> relatedIds,
boolean cascadeDelete)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationobjectId - the id of the object to which relations should be removedrelated - the relation field to followrelatedIds - the ids of the objects to be removed from the relationshipcascadeDelete - should be set to true if and only if you wish to also delete from the datastore all objects removed from the relationship
InvalidSchemaException - if the object model specified does not exist
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
void removeRelatedObjects(String schema,
SMValue objectId,
String relation,
SMList relatedIds,
boolean cascadeDelete)
throws InvalidSchemaException,
DatastoreException
schema - the name of the relevant object model; must be a type already declared for the current applicationobjectId - the id of the object to which relations should be removedrelated - the relation field to followrelatedIds - the ids of the objects to be removed from the relationshipcascadeDelete - should be set to true if and only if you wish to also delete from the datastore all objects removed from the relationship
InvalidSchemaException - if the object model specified does not exist
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
long countObjects(String schema)
throws InvalidSchemaException,
DatastoreException
schema - the name of the object model to count
InvalidSchemaException - if the object model specified does not exist
DatastoreException - if the connection to the datastore fails or the datastore encounters an error
Set<String> getObjectModelNames()
throws ConnectException
ConnectException - if the list of object models cannot be retrieved
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||