forum

Home / DeveloperSection / Forums / Create table for an abstract class in ActiveAndroid

Create table for an abstract class in ActiveAndroid

Anonymous User 1937 09-Jul-2015
Is it possible to create a table for an abstract class in ActiveAndroid. For example i could have an abstract class Animal with two concrete classes Dog and Cat. I want to be able to do something like:

List<Animal> animals = new Select().from(Animals.class).execute();
which would result in 'animals' containing all of the saved Cats and Dogs. Or:
Animal animal = new Select().from(Animals.class).where("name = ?", name).executeSingle();
Where 'animal' could be either a Cat or a Dog. Unfortunately when I do this I get an exception because no table is created for the abstract class Animal. Does anyone know how I might go about this using ActiveAndroid?

Updated on 09-Jul-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By