BackendlessUser relationships Android SDK

Hi. In my app, User table has one-to-many relationship with Car table. After login the user and fetching that relationship data, i get HashMap<String, Object>[] for user.getProperty(“cars”), but i would like to get List<Car>, just like when executing a regular backendless query for other tables with relationships. Is there a simple way to get this for User table? I have checked Android documentation, but still don´t know if i have to subclass BackendlessUser, or use a custom serializer, etc

Regards,
Andrés

Hi Andres,

You need to download the latest Backendless SDK for Android/Java (released today). You will find the following method in there:

Backendless.Data.mapTableToClass( string tableName, Class clazz );

where:
tableName - the name of the table, “Car” in your case
clazz - class which should be mapped to the table, again Car in your case.

Regards,
Mark

Thanks for your fast answer Mark.

That method should be used just after Backendless.initApp? Or it needs to be used before each query?

Regards,
Andrés

The method should be used only once in your app, after you make the initApp call.

Regards,
Mark

Ok, thanks Mark!