


init ( context ) // Get a Realm instance for this thread realm = Realm. age = 1 // Initialize Realm (just once per application) Realm. Use Realm objects like regular Kotlin objects val dog = Dog () dog. var dogs : RealmList = RealmList () ): RealmObject () //. var id : Long = 0, var name : String = "", var age : Int = 0, // Other objects in a one-to-one relation must also subclass RealmObject. var name : String = "", var age : Int = 0 ): RealmObject () open class Person ( // Properties can be annotated with PrimaryKey or Index. Non-nullable properties must be initialized // with non-null values. All properties are by default persisted. This // ensures that an empty constructor is generated.

open class Dog ( // You can put properties in the constructor as long as // all of them are initialized with default values. You must annotate all classes with `open`. import io. import io. // Define your model classes by extending RealmObject. Import the Kotlin extensions for Realm.
