Mybatis-No constructor found
来源:互联网 发布:abbyy finereader mac 编辑:程序博客网 时间:2024/05/22 01:49
No constructor found
Entity
public class MyClass{ private Long id; private Date create; private String content; MyClass (Long id, Date create, String content) { this.id = id; this.create = create; this.content = content; } //getters and setters}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
Mapper
@Select("SELECT * FROM MyTable WHERE id=#{id}") MyClass getMyClass (@Param("id") Long id);
- 1
- 2
- 3
和
@Results(value = { @Result(column = "id", property = "id", javaType = Long.class), @Result(column = "create", property = "create", javaType = Date.class), @Result(column = "content", property = "content", javaType = String.class) })
- 1
- 2
- 3
- 4
- 5
此时运行测试将会报错,即No constructor found **
解决方法
添加无参构造器以及各个getter/setter字段
阅读全文
0 0
- MyBatis - No constructor found
- mybatis--No constructor found
- Mybatis-No constructor found
- No constructor found错误 mybatis笔记
- MyBatis-Mapper中错误No constructor found...
- Mybatis 报错 No constructor found in xx类
- kotlin mybatis:No constructor found in void matching
- Mybatis 报错 No constructor found in xx类
- 在写Mybatis时遇到的问题:No constructor found in 包名+类名
- JsonMappingException: No suitable constructor found for type
- 【SpringBoot】“没有默认的构造器”,No default constructor found;
- 使用Spring报错:No default constructor found;
- no suitable constructor found, can not deserialize from Object value (missing default constructor or
- Could not instantiate bean class [com.bjsxt.service.UserService]: No default constructor found;
- Spring启动时报异常:No String constructor found on type [java.lang.reflect.Method]
- akka创建actor时报错:IllegalArgumentException: no matching constructor found on class $iwC$$iwC$$iwC$$iwC$
- org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [si
- spring No default constructor found; nested exception is java.lang.NoSuchMethodException: com.slj.mo
- 和苹果抢头条!微信深夜宣布图文支持插入其他公号文章链接
- E
- Pwnable.kr---input
- 最简单的windows 程序
- java 注解学习笔记
- Mybatis-No constructor found
- sklearn特征工程
- LeetCode——Two Sum
- eclipse脱离终端独立运行
- 工信部放大招:将统一安卓消息推送标准,约束流氓APP
- 面试中的那些 Git 问题
- the progress bar
- 苹果A10X芯片随新款iPad Pro现身,4核变6核,性能逆天
- 采用磁共振技术,半年签下华为,他要用无线充电解放家电、笔记本、无人机