-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
?
-
5
-
1138
-
Kotlin Beta sprint 50
Similar to @PersistedName for fields (see #590), we should provide the option of mapping Kotlin class names to their underlying (persisted) name.
@PersistedName(name = "myPersistedName") class Example : RealmObject { // ... }
Other API's will also be affected by this:
- RealmClass should return the persisted name, not the public (Kotlin) name.
- RQL queries should support both the persisted and public names.
TODO:
// Step 1
[ ] Add a CLASS annotation target to PersistedName.kt.
[ ] Modify AccessorModifierIrGeneration.modifyPropertiesAndCollectSchema to account for persisted values (perhaps no changes needed here).
[ ] Modify RealmModelSyntheticPropertiesGeneration (see addSchemaMethodBody() where irClass.name.identifier is used, maybe other places as well).
[ ] Validate that persisted and public names are a unique in the Realm. They are not allowed to overlap. This check should happen at compile time.
[ ] Verify in Realm Studio that schema is modified correctly.
// Step 2
[ ] Make sure that RealmClass returns the persisted name, not the public (Kotlin) name in the model class.
// Step 3
[ ] Verify that queries can use both persisted and public names in queries.
- depends on
-
RKOTLIN-388 Add support for `@PersistedName` annotation for fields to override underlying name
- Closed