forked from mongodb/docs-realm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9919b5a
commit fc3d112
Showing
7 changed files
with
72 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
source/examples/generated/kotlin/SchemaSync.snippet.sync-define-embedded-object.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
class _Frog : RealmObject { | ||
class Frog : RealmObject { | ||
@PrimaryKey | ||
var _id: ObjectId = ObjectId() | ||
var name: String = "" | ||
var age: Int? = null | ||
// Embed a single object (MUST be optional) | ||
var favoritePond: Pond? = null | ||
var favoritePond: EmbeddedPond? = null | ||
} | ||
|
||
class _Forest : RealmObject { | ||
class Forest : RealmObject { | ||
@PrimaryKey | ||
var _id: ObjectId = ObjectId() | ||
var name: String = "" | ||
// Embed multiple objects (can have many ponds) | ||
var forestPonds: RealmList<Pond> = realmListOf() | ||
var forestPonds: RealmList<EmbeddedPond> = realmListOf() | ||
} | ||
|
||
class Pond : EmbeddedRealmObject { | ||
class EmbeddedPond : EmbeddedRealmObject { | ||
var name: String? = null | ||
} |
8 changes: 4 additions & 4 deletions
8
source/examples/generated/kotlin/SchemaSync.snippet.sync-define-inverse-relationship.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
class _Pond : RealmObject { | ||
class Pond : RealmObject { | ||
@PrimaryKey | ||
var _id: ObjectId = ObjectId() | ||
var name: String = "" | ||
// Backlink to the `Frog` that has this `Pond` as its favorite | ||
val frog: RealmResults<_Frog> by backlinks(_Frog::favoritePonds) | ||
val frog: RealmResults<Frog> by backlinks(Frog::favoritePonds) | ||
} | ||
class _Frog : RealmObject { | ||
class Frog : RealmObject { | ||
@PrimaryKey | ||
var _id: ObjectId = ObjectId() | ||
var name: String = "" | ||
var age: Int? = null | ||
// To-many relationship (can have many ponds) | ||
var favoritePonds: RealmList<_Pond> = realmListOf() | ||
var favoritePonds: RealmList<Pond> = realmListOf() | ||
} |
2 changes: 1 addition & 1 deletion
2
source/examples/generated/kotlin/SchemaSync.snippet.sync-define-to-many-relationship.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters