orika-mapper/orika

ma.glasnost.orika.MappingException: While attempting the following mapping

nice-kai opened this issue · 0 comments

log
ourceType = com.mx.server.search.poi.fusion.framework.entity.dao.es.DifferenceDO
destinationType = com.mx.server.search.poi.fusion.framework.entity.base.DifferenceBaseBean
Error occurred: ma.glasnost.orika.MappingException: While attempting the following mapping:
sourceType = com.mx.server.search.poi.fusion.framework.entity.dao.es.DifferenceDO
sourceProperty = data(JSONObject)
destinationType = com.mx.server.search.poi.fusion.framework.entity.base.DifferenceBaseBean
destinationProperty = data(JSONObject)

code
`
JSONObject jsonObject = new JSONObject();
jsonObject.put("mxId", "aaaa");

    DifferenceDO differenceDO  = new DifferenceDO();
    differenceDO.setData(jsonObject);

    DifferenceBaseBean aaa = getCopy(differenceDO, DifferenceBaseBean.class);

`

DifferenceBaseBean
`
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@DaTa
@AllArgsConstructor
@NoArgsConstructor
public class DifferenceBaseBean implements Serializable {

private String mxId;
private String from;
private String fromCategory;
private JSONObject data;
private Integer status;

}
DifferenceDO
import com.mx.server.search.poi.fusion.framework.entity.base.DifferenceBaseBean;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@DaTa
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class DifferenceDO extends DifferenceBaseBean {

private String createTime;
private String updateTime;

}
`
please help me to tell me why.
Thank you very much.