I wants to save a key value pairs in the DB but Realm stops the compiling of the project when getting object like so
See original GitHub issueGoal saving keyVlaue pair in the DB
Expected Results keyValue pairs saved in the DB
Actual Results the project stops compile as of Realm doesn’t generate proxy classes
Code Sample
public class KeyValue <T extends RealmObject> extends RealmObject{
@PrimaryKey
private String key;
private T object;
public RealmKeyValue() {
}
public void setKeyValue(String key, T object) {
this.key = key;
this.object = object;
}
}
Version of Realm and tooling 3.1.4
Realm sync feature enabled: no
Android Studio version: 2.3.2
Which Android version and device: 6
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Using dictionaries to store data as key-value pairs
The dictionary stores objects as key-value pairs and can be used to represent complex real-world data.
Read more >Realm: Create reactive mobile apps in a fraction of the time
Realm is installed as a Gradle plugin. Step 1: Add the class path dependency to the project level build.gradle file. Copy to clipboard...
Read more >GitLab Container Registry administration
With the GitLab Container Registry, every project can have its own space to store Docker images. Read more about the Docker Registry in...
Read more >TACACS+
A program which services network requests for authentication and authorization, verifies identities, grants or denies authorizations, and logs accounting ...
Read more >Why the Hell Would I Use Node.js? A Case-by-case Tutorial
Server-side Web Application With a Relational Database Application. Ruby on Rails was once the clear choice as a tool to access relational databases...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The problem is that each generic type of this class would be a new table, and I don’t think that can be detected.
It would work if generics worked like they do in C++ but it doesn’t.
It isn’t like we don’t support that because we are grumps, I just isn’t clear what it would mean, when storing stuff in the DB. 😉 So, I have to ask:. When you say “I want to do something like that”, what do you mean, exactly? What are you trying to accomplish? Happy to help, with a little more info…