MessageEntity / User
rainman-wf opened this issue · 2 comments
rainman-wf commented
Hello! I need to save message text with entities to edit it inline buttons later keeping message in original view. I've created corresponding DB tables to save message data. But I can't create User object to put it into Entity user field, because all User class fields are private and has no setters.
pengrad commented
I see...
May I suggest you a workaround with data serialization in Json?
You can have another field in DB which will store json data.
You will save it via:
String jsonString = new Gson().toJson(user);
// save string to DB
And read it creating entities as:
// load json string from DB
User user = new Gson().fromJson("{id: 12312}", User.class);
rainman-wf commented
So... I haven't other choice right now. But it's not the best practice. It would be great you provide this feature in a future update.
Thank you!