Mapping a field to multiple tables

I have an object, WorkoutItem, with a property, exercise, of type IExercise. IExercise has two implementations, Lift and Aerobic. If I attach a Lift to to a WorkoutItem and save it, the Lift table get created as expected. But then if I attach an Aerobic to another WorkoutItem and save it, an Aerobic table never gets created.

I was curious as to if this is even supported.

1 Like

Devin,

Classes which you use to store data essentially represent the persistent storage. Since the persistent storage does not allow abstractions with multiple “implementation”, those are not supported by Backendless at the classes level either. As a result, what you’re trying to accomplish will not work as you’d expect.

If you have a type A which is related to type B, that relation is constant and does not allow for polymorphism.

Regards,
Mark

I can come up with ways to work around it. Thanks Mark.