Message:

Subscribe rss
Blog categories
All | Backendless features
Feature 123: Custom mapping between Data tables and Client classes
May 12, 2015 by markpiller

In my previous post I described how data tables in Backendless map to the client-side classes whose instances contain persisted data objects. However, there are scenarios when the default mapping is undesirable. In that case, Backendless client libraries provide an API to override the mapping. For example, consider the following data table (Restaurant):

Suppose that for some reason the client-side class for the objects in the Restaurant table must be called PlaceToEat. The mapping between the Restaurant table and the PlaceToEat class can be established using the following API:

Where the  PlaceToEat class has the following structure (class’s fields and properties must match the table columns):

It is recommended that mapTableToClass method is called right after the initApp method, that is before any other API which fetches data from the server.

Share this post
Tweet about this on TwitterShare on FacebookGoogle+