I have a tree with some level. how to save it in ActiveAndroid ORM? I want to save it but just saved the first layer with a null child. All child objects have the same property.
[
{
"childs": [
{
"childs": [
{
"childs": [
{
"childs": null,
"id": 35,
"parentId": 11,
"listLevel": 3
},
{
"childs": null,
"id": 36,
"parentId": 11,
"listLevel": 3
}
],
"id": 11,
"profileId": null,
"parentId": 5,
"listLevel": 2
},
{
"childs": [
{
"childs": null,
"id": 40,
"parentId": 12,
"listLevel": 3
}
]
}
]
}
]
}
]
its the model of json
@Table(name = "ListItemTable") public class ListItemTable extends Model {
@Column(name = "myId")
public Long myId;
@Column(name = "childs")
public List<ListItemTable> childs;
@Column(name = "listLevel")
public int listLevel;
@Column(name = "parentId")
public int parentId;
public ListItemTable() {
super();
}
}