My model is like:
public class MyModel{
private String mId;
private String mName;
T mAnObject;
}
How can I store T object in database
.
My model is like:
public class MyModel{
private String mId;
private String mName;
T mAnObject;
}
How can I store T object in database
.
Example: Object myObj has three properties: String title, String subtitle, String text
1 - You can save them as separate database rows and then when you read from the database you recombine them to create your Object.
2 - You can also use Json to save the properties, this way you only need to store a single String in the database and when you read from the database convert the Json String to your Object.
You can save it with JsonNode class