我在firestore数据库中的数据结构应该看起来像这样
从图像上看,our_array
字段是一个数组,其中包含数据类型的字段-内部有Map。
我需要创建一个简单的POJO以便按设计插入数据。
我当前的POJO课:
class ProductList{
private boolean availability;
private Object[] our_array; //I have doubts about this one
private String product_title;
… //Getters & setters
}
如何构造上面的数据集,特别是其中包含Map的our_maps
数组?
答案 0 :(得分:0)
首先创建一个产品pojo:
class Product {
private String productName;
…
…
// getters / setters
}
然后您的ProductList类可以包含一个产品列表:
class ProductList {
private boolean availability;
private List<Product> our_productList;
...
//Getters & setters
}