Add support for Weak/Strong links aka. Cascading Deletes#5678
Add support for Weak/Strong links aka. Cascading Deletes#5678
Conversation
|
Oooo this is great 😄 I wonder if this will be in 5.0 along with all the other goodies |
|
Where can we find what release this will be in or what will be in the next release? |
# Conflicts: # CHANGELOG.md # dependencies.list # realm/realm-annotations-processor/src/main/java/io/realm/processor/ClassMetaData.java # realm/realm-annotations-processor/src/main/java/io/realm/processor/RealmProxyClassGenerator.java # realm/realm-library/src/main/cpp/io_realm_internal_OsObject.cpp # realm/realm-library/src/main/cpp/io_realm_internal_OsSchemaInfo.cpp # realm/realm-library/src/main/cpp/io_realm_internal_Table.cpp # realm/realm-library/src/main/cpp/java_accessor.hpp # realm/realm-library/src/main/cpp/jni_impl/android_logger.cpp # realm/realm-library/src/main/cpp/jni_util/java_exception_thrower.cpp # realm/realm-library/src/main/cpp/jni_util/log.hpp # realm/realm-library/src/main/cpp/object-store # realm/realm-library/src/main/cpp/util.hpp
|
¯\(ツ)/¯ |
|
Sorry. This was put on hold due as we discovered we needed a few more internal changes before it made sense to release this. I don't have a new timeline unfortunately 😢 |
|
Oh I see now :( |
|
Realm 5.8.0. - not found cascade delete. |
|
Hi, They add row as per defined with db structure but when deletion comes we need to manage that for every model. does realm provides cascasde deletion ? |
|
disclaimer: I am not a member of Realm
yep
nope |
|
According to @roberhofer, this is coming. See #761 (comment). |
|
any progress? |
|
No progress on that yet. We will however release "Embedded Objects" very soon. They will automatically "cascade delete". That will however not cover all needs. |
Closes #1104
This PR adds support for the Core concepts of Weak/Strong links or effectively Cascading deletes.
The semantics are:
In particular, this solves the most common cascading delete problems we have seen:
The public API is a new annotation:
API Thoughts:
Cycled through a few ideas before ending on a single
@StrongRelationship. This mimics the current behavior of e.g@Requiredwhere we only annotate things if different from default behavior. It restricts the number of "types" of relationships we can support, but I don't think that is a problem for the foreseeable future.Other things attempted:
Should we add a
@WeakRelationship? Nice for symmetry ala@Nullable/@NonNullbut our own API does not have the precedence.TODO:
master