22. Mybatis 和 实体类的一个错误:Cause: java.lang.IllegalArgumentException: argument type mismatch] with root


  1. 错误展示:

  2. 实体类:

public class DeviceTypeImg {
    private LDeviceType deviceType;
    private LImg icon;
    public DeviceTypeImg(LDeviceType deviceType, LImg icon) {
        this.deviceType = deviceType;
        this.icon = icon;
    }
    public LDeviceType getDeviceType() {
        return deviceType;
    }
    public void setDeviceType(LDeviceType deviceType) {
        this.deviceType = deviceType;
    }
    public LImg getIcon() {
        return icon;
    }
    public void setIcon(LImg icon) {
        this.icon = icon;
    }
}
  1. MyBatis xml:
<?xml version="1.0" encoding="UTF-8"?>


  
    
      
      
      
      
      
      
      
      
    
    
      
      
    
  
  

  1. 解决方式
    把实体类的构造函数去掉