什么情况下需要在realm中使用gson反序列化?

Under what circumstances we need to use gson to deserialize in realm?

我正在为 Android 探索 Realm。当我们可以使用领域查询更新时,我们是否需要使用 gson 反序列化到对象?

以及什么情况下需要使用gson反序列化?

谢谢。

GSON serialization/deserialization 集成的存在纯粹是为了与 JSON 一起工作。例如,将此类集成与 Retrofit 库(请参阅 http://square.github.io/retrofit/)结合使用会很方便,它允许您直接将 REST API 响应解析到您的 Realm 对象中。

更多细节见官方文档