find by ID is throwing exception

Hello

I am doing the following

Backendless.Data.of( "Users" ).findById( myUser.getUserObjectId(),  new AsyncCallback<Map>() {
    @Override
    public void handleResponse(Map foundUser) {
        
    }


    @Override
    public void handleFault(BackendlessFault fault) {
       
    }
});

But I am getting the following exception

java.lang.IllegalArgumentException: Table 'Users' is not accessible through this signature. Use Backendless.Data.of( BackendlessUser.class ) instead
at com.backendless.Persistence.of(Persistence.java:756)

What is it that i am doing wrong here? I assume this method does not have to the custom class and can use the “string” version of it like any other method

Hello,

just for Users table you have to write Backendless.Data.of( BackendlessUser.class ), not string signature.
For other tables you may use strings as a table names.

Regards,
Stanislaw

Thanks Stanislaw. So that means I can use the backendlessUser class to do this and I don’t need to create my custom class, correct?

Hello,

yes, you can use the BackendlessUser class without creating your own class.

Regards, Olga