S
S
Sarrius2016-06-23 21:02:42
Android
Sarrius, 2016-06-23 21:02:42

How to get around the inheritance bug in RealmObject?

Today, created an abstract class, extending it as RealmObject and inheriting all DTOs/Entities from it, hoping to push it into RecyclerView . But what a shock I was when I found out that Realm does not support inheritance ... How can I get around this bug? I beg you help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Gapchenko, 2016-06-24
@artemgapchenko

Judging by the discussion of the problem on github, there are two solutions:
1. Use composition instead of inheritance.
2. Wait until they add support for polyformism.
Version 1.0, after which they promised to add the polyform behavior of Realm entities, has already been released. There are no deadlines yet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question