realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

How to store List<Long> with relam? - Question

Open lazarvgd opened this issue 9 years ago • 3 comments

Hi, how can I store to Realm list of Long's?

For example i have class Person:

Person extends RealmObject{ private List accountId; }

Thanks

lazarvgd avatar Jul 31 '17 13:07 lazarvgd

As String. Just like you would with SQLite.

This will change when primitive list support is added, but this is not that time yet. Realm's getting there, though.

Zhuinden avatar Jul 31 '17 13:07 Zhuinden

store it in json array of integer format as a string the you can parse it from String and to string using GSON library

idok595 avatar Aug 07 '17 16:08 idok595

Hi @lazarvgd I assume the above answered your question. If not, feel free to reopen.

cmelchior avatar Aug 15 '17 08:08 cmelchior