{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/761","repository_url":"https://api.github.com/repos/realm/realm-java","labels_url":"https://api.github.com/repos/realm/realm-java/issues/761/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/761/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/761/events","html_url":"https://github.com/realm/realm-java/issues/761","id":54733746,"number":761,"title":"Inheritance / Polymorphism","user":{"login":"cmelchior","id":406066,"avatar_url":"https://avatars.githubusercontent.com/u/406066?v=3","gravatar_id":"","url":"https://api.github.com/users/cmelchior","html_url":"https://github.com/cmelchior","followers_url":"https://api.github.com/users/cmelchior/followers","following_url":"https://api.github.com/users/cmelchior/following{/other_user}","gists_url":"https://api.github.com/users/cmelchior/gists{/gist_id}","starred_url":"https://api.github.com/users/cmelchior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmelchior/subscriptions","organizations_url":"https://api.github.com/users/cmelchior/orgs","repos_url":"https://api.github.com/users/cmelchior/repos","events_url":"https://api.github.com/users/cmelchior/events{/privacy}","received_events_url":"https://api.github.com/users/cmelchior/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-java/labels/S:P2%20Backlog","name":"S:P2 Backlog","color":"dedede"},{"url":"https://api.github.com/repos/realm/realm-java/labels/T:Feature","name":"T:Feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":52,"created_at":"2015-01-19T07:26:24Z","updated_at":"2016-06-09T10:10:34Z","closed_at":null,"body":"A highly request feature is polymorphism. Mostly for use in ListAdapters, but a lot of other scenarios exists.\r\n\r\nWe need support for the following:\r\n- Abstract RealmObject classes\r\n- Query support\r\n\r\nExample\r\n```\r\npublic abstract Animal extends RealmObject {\r\n  private String name;\r\n}\r\n\r\npublic class Dog extends Animal {\r\n  private boolean willPlayCatch;\r\n}\r\n\r\npublic class Spider extends Animal {\r\n  private boolean isScary;\r\n}\r\n\r\n// Following should be possible\r\nRealmResults<Animal> animals = realm.where(Animal.class).equalsTo(\"name\",\"Foo\").findAll();\r\nString name = animals.get(0).getName();\r\n\r\nRealmResults<Dog> dogs = realm.where(Dog.class).equalsTo(\"name\",\"Foo\").and().equalsTo(\"willPlayCatch\", true).findAll();\r\nString name = dogs.get(0).getName();\r\n```"},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/224853722","html_url":"https://github.com/realm/realm-java/issues/761#issuecomment-224853722","issue_url":"https://api.github.com/repos/realm/realm-java/issues/761","id":224853722,"user":{"login":"henriquedesousa","id":12630569,"avatar_url":"https://avatars.githubusercontent.com/u/12630569?v=3","gravatar_id":"","url":"https://api.github.com/users/henriquedesousa","html_url":"https://github.com/henriquedesousa","followers_url":"https://api.github.com/users/henriquedesousa/followers","following_url":"https://api.github.com/users/henriquedesousa/following{/other_user}","gists_url":"https://api.github.com/users/henriquedesousa/gists{/gist_id}","starred_url":"https://api.github.com/users/henriquedesousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henriquedesousa/subscriptions","organizations_url":"https://api.github.com/users/henriquedesousa/orgs","repos_url":"https://api.github.com/users/henriquedesousa/repos","events_url":"https://api.github.com/users/henriquedesousa/events{/privacy}","received_events_url":"https://api.github.com/users/henriquedesousa/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T10:10:34Z","updated_at":"2016-06-09T10:10:34Z","body":"We've tried composition, but introduced way more problems. Now, instead of developing, we're lots of time hacking the models to fit our bussiness rules. Mangle it with retrofit, deserializers, and all hell broke loose!"}}
{"actor":{"display_login":"henriquedesousa"}}