Open cmelchior opened 9 years ago
Core issue: https://github.com/realm/realm-core/issues/746
Any progress in this issue? I have 3step hierarchy of linked objects, I have dozen of linked RealmList in last step of hierarchy. - that is wrappers of primitive objects that even do not have @primarykey - coz realm does not support list of primitives. It is tonne of biodegradable code for remove all linked objects.
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
Any updates?
Really sorry to keep you all in the cold on this feature. It's likely going to be one of the first features that we will tackle after our current P1 backlog issues are handled. Thanks for hanging in there!
+1
+1
+1
+1
+1
+1
+1
+1
+1
I also needed such a feature and achieved it quite easy, doing the following in iOS:
childrenToDelete
, which return all children that should be cascade deleted as an array.RLMRealm
named cascadeDelete
cascadeDelete
method I call recursively childrenToDelete
and get their children and so on until no more children are defined; I keep all of them in an array - this array contains all the objects, that should be deleted when I delete my main object.+1
+1
+1
See https://github.com/realm/realm-java/issues/2717 for ideas on how to implement this now, until we can add proper support for it.
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
++
It should be possible to delete linked objects as well using some defined policy.
Suggestion 1: Possible policies:
Suggestion 2: Try to provide the same semantics as the GC, i.e. root objects and strong/weak references. Once an object no longer has any references it is deleted.
Cocoa issue: https://github.com/realm/realm-cocoa/issues/1186