androiddatabasenosqlrealmproxy-classes

why do Realm generate proxy classes for all the model class?


I am trying to understand how does Realm for Android works under the hood. when I used the custom methods in our model class, couldn't see them in the generated proxy class.


Solution

  • The proxy classes extend your model class, which is why they cannot be final and need to be marked open in Kotlin, but that means that the proxy class automatically inherit all the methods from your model class.

    You can read https://academy.realm.io/posts/is-realm-magic-makoto-yamazaki/ if you are interested in more detail.