I have a case where I'm calling a copyToRealmOrUpdate(List
What would be the best possible solution for this? Would MyObject's property need to also have MyObject's primary key in order to query and delete those old orphaned objects? I could try some sort of app processing to remove them before the copyToRealmOrUpdate but it seems really heavy and only grows as the number of MyObjects grows.
Get a List
For each MyObject, query for the stored Realm MyObject.
Get RealmList from stored Realm MyObject
Loop through RealmList object and removeFromRealm
Thoughts?
Hi @maarek Sorry for the late response.
Yeah, unfortunately cascading deletes are not supported yet. You can follow progress on that here https://github.com/realm/realm-java/issues/1104
Right now your only option is something like what you outlined.
Are you planning to support cascade delete? If so what is the priority?
Yes, we are planning to support cascading deletes. It is currently under study in the core team.
+1
Was there a verdict on this? Saw that it got closed without any update on the support of cascading deletes? :)
@maarek I closed it as #1104 is the issue to follow instead.
+1 On this issue
+1 please
bump
@badjano this is duplicate of https://github.com/realm/realm-java/issues/1104
+1
Good job Realm Team. I think it's a great db.
Obviously needs more work for some features like cascade deletions but we can develop some object methods for that.
Thanks
+1
Any update on cascade delete?
Sync doesn't support it so ObjectStore doesn't implement it so Java is stuck in limbo.
Well, isn't that dangerous ? Realm is a graph database and links between objects can quickly get out of hand and it would be easy to CASCADE DELETE all the graph by the sole "spaghetti effect".
Please reopen, this was never solved.
It is a duplicate of #1104
5 years later?
@asymptotik They are quite quick 🤣