-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
BlockedThis issue is blocked by another issueThis issue is blocked by another issueDesign-RequiredT-Feature
Description
A highly request feature is polymorphism. Mostly for use in ListAdapters, but a lot of other scenarios exists.
We need support for the following:
- Abstract RealmObject classes
- Query support
Example
public abstract Animal extends RealmObject {
private String name;
}
public class Dog extends Animal {
private boolean willPlayCatch;
}
public class Spider extends Animal {
private boolean isScary;
}
// Following should be possible
RealmResults<Animal> animals = realm.where(Animal.class).equalsTo("name","Foo").findAll();
String name = animals.get(0).getName();
RealmResults<Dog> dogs = realm.where(Dog.class).equalsTo("name","Foo").and().equalsTo("willPlayCatch", true).findAll();
String name = dogs.get(0).getName();
kleisauke, bryant1410, markini, bryanleesh, ozodrukh and 336 morehenriquedesousa, wydong523, Hunter712, 5hmlA, sathishkumars92 and 5 moreomidrahasathishkumars92, dasshield and davidecastelloozodrukh, samyakjain, beshkenadze, NorseDreki, henriquedesousa and 15 moreezibyte, jfri, nargroves, wydong523, FarshadTahmasbi and 32 more
Metadata
Metadata
Assignees
Labels
BlockedThis issue is blocked by another issueThis issue is blocked by another issueDesign-RequiredT-Feature