Fork me on GitHub

org.apache.ibatis.executor.ExecutorException: No constructor found in xxxClass matching [java.lang.String, java.lang.Long, java.lang.String, java.lang.String, java.sql.Timestamp]

解决方案

为bean加上默认构造方法

public class User {

    private String username;

    private long id;

    private String sex;

    private String tel;

    private Date createData;

    //省略gettter and setter

    public User(String username, long id, String sex, String tel, Date createData) {
        this.username = username;
        this.id = id;
        this.sex = sex;
        this.tel = tel;
        this.createData = createData;
    }
    
    // 加上默认构造函数即可解决
   public User(){};
}
posted @ 2019-10-17 17:45  粥里有勺糖  阅读(464)  评论(0编辑  收藏  举报