Message:

Subscribe rss
Blog categories

In my previous two posts I described:

Of course both of the operations above can also be accomplished with the API. However, in this post I am going to show how to retrieve a data object which has a related geopoint. Consider the following object:
address object with geo - Feature 101: Loading data objects with related geopoints using API

The Address table has the location column of the GEOPOINT RELATIONSHIP type. There are three data objects in the table and one of them has a related geopoint. The geopoint is shown in the screenshot below.

Notice the geopoint’s metadata ( city: NEW YORK CITY ):

Continue reading

In my post yesterday I described how to declare a relationship in a data table schema with a geopoint. Now that you know how to create a table column which contains one or more geo points, I am going to show how to populate it with data.

If you follow the post from yesterday and add a table column of the GEOPOINT  type, your data objects in Backendless console will appear as shown below. Notice the location column:
geopoint relationship column in table - Feature 100: Creating relationships between data objects and geopoints

Continue reading

Data objects in Backendless may have related properties not only with other tables, but also with Geopoints. These relationships may be declared programmatically or using Backendless Console. In this post I review the process of declaring a Data-to-Geo relationship in a data table schema.

Once a relationship is declared, you can do the following:

  • Link/unlink/manage data objects with related geo points using console.
  • Use Backendless code generator to create client-side code which reflects the structure of the tables.
    Continue reading

Previously I have reviewed multiple techniques for loading data objects from the persistent server-side storage. There is a list of all articles categorized by topic. In this post I am going to review the API for loading data objects using an SQL query. I already wrote once about SQL queries in Backendless and that post described how to test queries using console. I recommend reading that post before reviewing the samples below.

Consider the following data tables:

There are 2 Person objects:
person objects - Feature 98: Loading data objects from server with an SQL query

Continue reading

Data objects stored in Backendless may have related objects through one-to-one or one-to-many collections. When objects are retrieved on the client side, these relations are materialized as collections of data in object’s fields or properties. Consider the following data object:
person with related addresses -  Feature 97: Update object's related collections using API

Continue reading

In my previous post where I showed how to update data objects in the persistent storage, my class for the data object looked like this:

Notice the class does not include any fields/properties for objectId , created or updated fields. Nevertheless, the call to save the updated object knew that it is already stored in Backendless. This is possible as a result of a feature that lets you declare any field or property your app might need. Also, notice the class neither implements any special interfaces nor extends any base Backendless classes – a pure data object class.

Once an object is stored in the Backendless data storage, any of its properties (except for the system ones) can be updated using the data update API. The API works the same way as the initial call for saving the object. To update a property value, simply modify it in the instance representing the saved object. The example below retrieves a saved object, modifies the “name” property and saves it back in the data store.

The data table and schema look as shown in the screenshots below:
person table - Feature 95: Updating data objects using API

Continue reading

Deleting an object in Backendless using the API is just as easy as creating or updating one. If an object has relations, they are broken up and the related objects are not deleted. The sample below retrieves the first object from a table and deletes it:

Person class – corresponds to the Person table show below:

person table - Feature 94: Deleting persistent objects using Data Service API

Continue reading

In my previous post I wrote how to load the first object from a data table using API. For the symmetry (and out of common sense) there is also API to load the last object from a data table. The last object is determined by the time when it is saved in the data storage. The most recently created (notice it is not the updated one) object is what the API returns.

Continue reading

There is an API for loading the very first object created in the table. The first object is determined by the value in the created column – Backendless picks the one with the smallest timestamp. The code below demonstrating loading an object from the Person table:
person table - Feature 92: Loading first object from a data table using API

Continue reading