Jackson:多个名为“defaultReference”的反向引用属性
我正在尝试将json(字符串格式)映射到对象,但收到以下错误
com.fasterxml.jackson.databind.JsonMappingException:多个名为“defaultReference”的反向引用属性
这是 json 字符串
{"pledge":"74","client":"66","date":"","originId":"1","qualityId":"2","grade":"19","packing":"4","tons":"1000","fromDate":"","toDate":"","type":0,"remark":"","status":0,"area":"1531","id":-1,"refNumber":"","log":"","user":""}
这是对象
@Entity
@Table(name="movement", catalog = "wsmill3")
public class MovementView implements java.io.Serializable {
private Integer id;
private Integer originId;
private Integer qualityId;
private String refNumber;
private Integer client;
private String clientRef;
private Integer grade;
private Integer packing;
private Integer pledge;
private Integer area;
private Date date;
private Double tons;
private Date fromDate;
private Date toDate;
private String remark;
private User user;
private Byte status;
private String log;
private Byte type;
//constructor, getter and setter
这是做映射的代码
String data = request.getParameter("data");
ObjectMapper mapper = new ObjectMapper();
MovementView movement = mapper.readValue(data, MovementView.class);
我不知道这个错误,我做了与我在杰克逊主页上阅读完全相同的方式。任何知道它的人,请帮助我