-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
?
-
6976
-
Not Needed
Currently having links to regular realm objects is not allowed in asymmetric objects. Trying to define a realm model like this
@RealmModel(ObjectType.asymmetricObject) class _Asymmetric { _Symmetric? symmetric; // ... } @RealmModel() class _Symmetric { // ... }
is disallowed by realm-core. Opening a realm with such schema will throw:
RealmException: Error opening realm at path <redacted>. Error code: 2016 . Message: Schema validation failed due to the following errors: - Asymmetric table with property 'Asymmetric.symmetric' of type 'object' cannot have a non-embedded object type.
But it is trivial to work-around this restriction by injecting an embedded object like this:
@RealmModel(ObjectType.asymmetricObject) class _Asymmetric { late List<_Embedded> embeddedObjects; // ... } @RealmModel(ObjectType.embeddedObject) class _Embedded { late RealmValue any; _Symmetric? symmetric; } @RealmModel() class _Symmetric { // ... }
From discussion with BAAS team they don't have any problems with supporting links to non-embedded objects, so I request we lift the restriction in realm-core as well, since it is not really enforced anyway.
- causes
-
RCPP-2 Allow non-embedded links in asymmetric objects
-
- Backlog
-
-
RNET-1056 Allow non-embedded links in asymmetric objects
-
- Backlog
-
-
RCOCOA-2185 Allow non-embedded links in asymmetric objects
-
- Backlog
-
-
RKOTLIN-920 Allow non-embedded links in asymmetric objects
-
- Backlog
-
-
RJS-2561 Allow non-embedded links in asymmetric objects
-
- Ready for Work
-
-
RDART-880 Allow non-embedded links in asymmetric objects
-
- Closed
-
-
RJAVA-1226 Allow non-embedded links in asymmetric objects
-
- Closed
-