Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support embedded objects #551

Closed
rorbech opened this issue Nov 15, 2021 · 6 comments · Fixed by #797
Closed

Support embedded objects #551

rorbech opened this issue Nov 15, 2021 · 6 comments · Fixed by #797
Assignees

Comments

@rorbech
Copy link
Contributor

rorbech commented Nov 15, 2021

We should support defining realm objects as embedded to indicate that object life cycle should follow its parent.

@rorbech
Copy link
Contributor Author

rorbech commented Apr 20, 2022

Requires C-API support: realm/realm-core#5408

@thipokch
Copy link

thipokch commented May 9, 2022

@rorbech
I believe release 11.15.0 ( https://github.com/realm/realm-core/blob/master/CHANGELOG.md#11150-release-notes ) includes the C-API for embedded object. I'll be happy to help out if you need a hand.

@rorbech
Copy link
Contributor Author

rorbech commented May 9, 2022

@rorbech I believe release 11.15.0 already included the C-API for embedded object: https://github.com/realm/realm-core/blob/master/CHANGELOG.md#11150-release-notes

@thipokch Yep. The core part is already in place and included in the PR #797.

@thipokch
Copy link

thipokch commented Jun 8, 2022

@rorbech Congrats on the GA release! 🎉 I'm so looking forward to trying embedded objects out.

@thipokch
Copy link

thipokch commented Jun 8, 2022

@rorbech
Quick question: Does the embedded object support a sealed interface polymorphism as RealmObject does?

class Home() : RealmObject {
  var pets : RealmList<Animal> = realmListOf()
}

sealed interface Animal {
  class Dog(): Animal, RealmObject {
    // ...
  }
  class Cat(): Animal, RealmObject {
     // ...
  }
}

@rorbech
Copy link
Contributor Author

rorbech commented Jun 8, 2022

Quick question: Does the embedded object support a sealed interface polymorphism as RealmObject does?

@thipokch We don't support polymorphic inheritance on neither RealmObject nor EmbeddedObject. You can track support for that through #801.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants