Realm ORM: how to deal with Maps?
<p>I am creating an Android app and I need to persist a <code>Map&lt;String,MyClass&gt;</code>.
I've just started to use <a href="https://realm.io" rel="noreferrer">Realm ORM</a>, as it supports one-to-one and one-to-many, enumerations and lists. I also found a workaround for lists of strings (i.e. I have to create a StringWrapper class encapsulating a string.
However, from the <a href="https://realm.io/docs/java/latest/" rel="noreferrer">documentation</a> I understand there is no easy way like <code>RealmMap</code>, as it happens for lists.
So, I'm looking for the best way to persist a map.
My current idea is to replace my map with a list of objects <code>KeyValueObject</code> encapsulating a <code>String</code> (the former map key) and a <code>MyClass</code>. Similarly to <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Map.Entry.html" rel="noreferrer"><code>Map.Entry</code></a>.
Is there any other solution that does not need me to rework the domain model for technology reasons?</p>