我是杰克逊和Hibernate OGM的春天的新手。我从Web请求
获取如下JSON格式"Order":
{
"Orderdata": [ {"orderNo" : "1","location":"A"},{"orderNo" : "2","location":"B"},..]
}
订单的Pojo类
class Order implements Serializable{
@ElementCollection
private List<OrderData> Orderdata = null;
//getter and setter
}
将文档插入MongoDB后。我得到如下
"Order": {
"Orderdata": [
{
"Orderdata": {"orderNo" : "1","location":"A"}
},
{
"Orderdata": {"orderNo" : "2","location":"B"}
},
...
]}
这里我需要避免&#34; Orderdata&#34;创建的每个文档内的名称。请帮我解决这个问题。