Spring引导休息正在添加额外的字段“target”

时间:2017-05-22 12:09:13

标签: spring-boot spring-data spring-restcontroller spring-mongodb

@Document("user")
public class User
  @Id
  String id;

  @DbRef(lazy=true)
  Group group;
}


@Document("Group")
public class Group{
  @Id
  private String Id;

  private string code;
}

JSON用户

[
  {
    "id": "5922bccbbba56342fc55a73f",
    "group": {
      "id": "5922bccbbba56342fc55a73d",
      "code": "ROLE_ADMIN",
      "target": {
        "id": "5922bccbbba56342fc55a73d",
        "code": "ROLE_ADMIN"
      }
    },

  }
]

问题是我在json中获得了一些目标属性,而这在课堂上并不存在。有什么想法吗?

更新DbRef(lazy = true) add the target attribute

0 个答案:

没有答案