1
would like to have a data structure in the Firebase database Realtime similar to this:
{
"codigo": "01",
"Data": "1234567890",
"usuario": "{codigo : 01, nome : Rafael}"
}
have the class:
class Consulta {
String codigo;
Long data;
Usuario usuario;
}
the user class has more attributes, but I just want to save those that are in JSON.
How do I save these values to stay in this structure? How do I read these values?
If user was an Arraylist, how would this reading and writing?
Thanks, but when I have saved a user on some other screen, I want you to save all attributes. And putting annotation will block this. But the focus gives question is how to save and how to read and transform the answer into a query class object.
– Rafael Silva