question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for `@LinkingObjects`

See original GitHub issue

Similar to Realm Java, we should add support for mapping inverse relationships. The Java annotation of @LinkingObjects seem fine for this.

class Dog : RealmObject { 
  var name: String = "Fido"
  @LinkingObjects("dog")
  val parents: RealmResult<Person> = RealmResults.empty()
}

class Person : RealmObject {
  var name: String = "Jane"
  var dog: Dog? = null
} 

In Java, the LinkingObjects implementation was highly annoying in Kotlin as it wasn’t possible for end users to construct RealmResults themselves which meant that they were forced to do var parents: RealmResults<Person>? = null

We should definitely lift that restriction in the Kotlin SDK. Suggestion would be provide a RealmResults.empty() factory method that basically emulate the empty Results from Core, i.e. it always contains 0 elements. Semantics around queries, adding changelisteners etc. needs to be defined.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:10

github_iconTop GitHub Comments

4reactions
cmelchiorcommented, Sep 16, 2022

Hi @ganfra We just started the implementation of this, so hopefully we have something to share soon.

4reactions
cmelchiorcommented, Mar 14, 2022

Hi @CarsonRedeye . No update yet…it is on our short-term roadmap to implement, but we don’t have any updates right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EmbeddedObject with LinkingObjects - Realm
Using the classes from the documentation here, I have an existing business with a List of embedded addresses. When making an in memory...
Read more >
Understanding LinkingObjects in Realm Xcode 12, Also ...
With LinkingObjects we can specifically get the objects we want to work with. It's super handy when you want to add an observer...
Read more >
Add support for linking objects properties in Swift. - Gitea Yiem
Add support for linking objects properties in Swift. tags/v0.100.0. Mark Rowe преди 6 години. родител. f7db91f993. ревизия. d1df0a1580.
Read more >
3ds Max 2023 Help | Linking Objects to Delegates
Under the Delegates list, click Add to add delegates to link with the objects you added in the previous step. Each object in...
Read more >
Linking Objects
Linking Objects. Within the UI you may map a particular metadata ... Click the Edit (pencil icon) next to add value in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found