Using relationships between Users and other data table and when a class already exists (Swift)

Hey all,

My app has users, and then I have a one to many relationship between the user and a table called “Session”. However, I already have a class called Session in my app. I realize this is very probably a serious noob question but I am unsure how I make a Session class for Backendless when this already exists.

Just trying to understand how this all works so I can move my entire app over.

Thanks,
Rob

Hi Robert,

For each data model class Backendless PersistenceService creates the table of the same name. So, you cannot have two classes with the same name.

Regards,
Slava

So my coredata class is called Session. How do I get around this issue?

A temporary workaround would be to name the table and thus the client class something different than Session, for example AppSession.

We’re working on a way to allow custom mapping between classes you define and tables on the backend.

It would be cool to have it work on the way that get and set property works for the user table.
A bit more straightforward. I realize I lose the dynamic table creation but I’d be ok with that to keep simplicity.

Yes I realized this workaround also last night.
Thanks for your swift documentation. The more the better including sample projects for data mangement with relationships including back to the user table.

Thank you team.
Rob