SpringBoot问题之org.apache.ibatis.executor.ExecutorException: No constructor found in...的问题
小记:
Caused by: org.apache.ibatis.executor.ExecutorException: No constructor found in com.ris.event.track.model.EventTrack matching [java.lang.Long, java.lang.String, java.lang.Long, java.lang.Long, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.sql.Timestamp, java.sql.Timestamp, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.sql.Timestamp]
比如创造了一个带有参数的构造方法,那么无参的构造方法必须显式的写出来,否则会编译失败"这句话有点不妥,应该这么理解:每个类至少要有一个构造函数,如果你自己构建了一个带有参数的构造函数而没有再显示的写出无参的构造函数也是可以的,不过当你尝试通过一个无参的构造函数来构建(new)时,此时编译器才会报错,因为找不到这个无参的构造函数。也就是说当一个类你没有给他构造函数,则编译器会自动补上一个无参的,若有的话就不会,你需要显示将此无参的构造函数写出来。
所以在创建某个实体类的时候,应该养成一个好习惯,显示构造一个无参构造函数,这样就会避免后面遇到的奇葩问题了。
- 点赞 1
- 收藏
- 分享
- 文章举报
- SpringBoot问题之org.apache.ibatis.executor.ExecutorException: No constructor found in...的问题
- org.apache.ibatis.executor.ExecutorException: No constructor found in com.contentsales.meta.User
- org.apache.ibatis.executor.ExecutorException: No constructor found in...
- MyBatis Error:org.apache.ibatis.executor.ExecutorException: No constructor found in pojo
- org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the
- SpringBoot整合MyBatis(多数据源)的org.apache.ibatis.binding.BindingException问题
- org.apache.ibatis.executor.ExecutorException:A query was run and no Result Maps were found for the M
- org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the
- org.apache.ibatis.executor.ExecutorException: There was no TypeHandler found for
- 异常org.apache.ibatis.executor.ExecutorException: There was no TypeHandler found for parameter..
- org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'Teacher' in
- mybatis多参数查询问题:org.apache.ibatis.binding.BindingException: Parameter 'name' not found. Available par
- 使用springboot连接druid,Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Priority
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'xx'的问题
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'cla
- SpringBoot 构建java.lang.ClassNotFoundException: org.unbescape.html.HtmlEscape问题
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'cla
- 学习springboot(三)——springboot+mybatis出现org.apache.ibatis.binding.BindingException: Invalid bound state
- Spring+Mybatis 查询所有数据时发生异常:org.apache.ibatis.reflection.ReflectionException: There is no getter for
- spring boot 整合mybatis org.apache.ibatis.binding.BindingException: Invalid bound statement(not found)