How to retrieve relationship class from current user

Hi,
I am working on Android platform and wanna obtain relationship information from user.
Here is my code:

BackendlessUser user = Backendless.UserService.CurrentUser();
ArrayList<String> relations = new ArrayList<String>();
relations.add(“records”); // name of the relation column in Users

Backendless.Data.of(BackendlessUser.class).loadRelations(user, relations, new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser user) {
// user - object with loaded relations.
// now you can do this:

ArrayList<Records> prefs = (ArrayList<Records>) user.getProperty(“records”);

}
@Override
public void handleFault(BackendlessFault backendlessFault) {
Log.d(TAG, "backendlessFault: " + backendlessFault.toString());
}
});

And errors are returned from Log:backendlessFault: BackendlessFault{ code: ‘IllegalArgumentException’, message: ‘java.util.HashMap[] cannot be cast to java.util.ArrayList’ }

I have no idea how to create a HashMap[] and cast the return values into it.Please help!!

Hello,

Try adding the following line before you make the loadRelations call:

Backendless.Data.mapTableToClass( "Records", Records.class );

Regards,
Mark

Unfortunately i have put this right below the init command
And the Records class was defined by the code generator.

Have solved this issue.

I put

Backendless.Data.mapTableToClass( "records", Records.class );

instead of

Backendless.Data.mapTableToClass( "Records", Records.class );

Sorry for any inconvenience caused!
Cheers