[SSM]There is no getter for property named 'token_exptime' in 'class com.hdu.model.Student'
org.mybatis.spring.MyBatisSystemException : nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘token_exptime’ in ‘class com.zyd.beans.Admin’
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
Caused by: org.apache.ibatis.reflection.ReflectionException : There is no getter for property named ‘usersname’ in ‘class com.zyd.beans.Admin’
…
原因:
实体类的定义里和数据库里列名定义相同为token_exptime,因此自动获取到的变量都是和实体类中定义的相同名字为token_exptime,
但在mapping的xml文件中数据库语句里
token_exptime 写成了tokenExptime,spring找不到token_extime因此就报错.
反观这个错误发生的原因,这个mapping.xml文件是mybatis generater
自动生成的,数据库中定义为token_exptime,所以只能有一个可能那就是自动生成的代码中对参数的定义是没有下划线”_”这种符号的,所以以后在数据库中定义属性名字是不应该带下划线,否则要改很多地方。
[SSM]There is no getter for property named 'token_exptime' in 'class com.hdu.model.Student'相关推荐
- 关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'...
现在流行的 ssm(spring + struts2 + myBatis) 持久层的mybatis是需要配置映射器的,找了个demo连接的数据库是MySQL 于是就修改了一下弄成了连接Oracle的 ...
- 关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'
现在流行的 ssm(spring + struts2 + myBatis) 持久层的mybatis是需要配置映射器的,找了个demo连接的数据库是mysql 于是就修改了一下弄成了连接oracle的 ...
- Mybatis报错:There is no getter for property named 'xxxx' in 'class xxxx之解决办法
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Reflecti ...
- mybatis 报错There is no getter for property named 'XXX' in 'class com.xx.xx'
mybatis报错信息记录: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException ...
- resultMap使用不当导致出现There is no WRITEABLE property named 'student_id' in class 'com.ssi.model.Stud
修改前: Student.java Student.xml 提示:There is no WRITEABLE property named 'studentId' in class 'com.ssi. ...
- SSM框架报错分析(一)——There is no getter for property named 'XXX' in 'class java.lang.String'...
一.发现问题<select id="queryStudentByNum" resultType="student" parameterType=" ...
- There is no getter for property named 'XXX' in class 'aaa.bbb.ccc'(终极骚操作的解决方法)...
使用SpringBoot整合Mybatis时,遇到了像标题的异常,博主当时是用Bean类对象作为参数的,所以百度了很久都没有建设性答案.贴一下报错的xxxDao文件和xxxMapper.xml文件: ...
- here is no getter for property named 解决方案及问题分析
SSM框架中没有 There is no getter for property named 'name' in 'class com.itheima.domain.UserVO' 翻译成中文的大致意 ...
- There is no getter for property named 'XXX' in class 'aaa.bbb.ccc'(终极骚操作的解决方法)
使用SpringBoot整合Mybatis时,遇到了像标题的异常,博主当时是用Bean类对象作为参数的,所以百度了很久都没有建设性答案.贴一下报错的xxxDao文件和xxxMapper.xml文件: ...
最新文章
- tomcat源码学习
- wxWidgets:将所有内容与 wxString 相互转换
- Eclipse变量名自动补全问题 自定义上屏按键为TAB
- @transactional注解失效情况
- oracle 10 数据库覆盖
- 智能指针分配动态数组
- nginx与php处理用户请求,配置 NGINX 处理 PHP 的请求《 LEMP 网站应用运行环境 》
- 获得iframe中的对象的方法
- iOS开发之抓包工具的Charles的初步安装使用:一步一步教你学会抓包工具Charles的使用(下载破解+代理设置+证书配置)
- React 引入阿里矢量图标方法
- 卡巴斯基7.0最新激活码
- Linux驱动里的wmb函数
- 二进制文件文本文件和二进制数据
- springboot项目中访问不到html页面问题
- 页码怎么设置从某一页位置开始,word文档如何设置开始页面
- RabbitMQ--扩展--11--均衡负载
- [数据讨论][解包相关]下江小春也能轻松掌握的碧蓝档案提取工具
- 损坏Word文档的几种修复方法
- 教你看懂晦涩的5G英文缩写-初学者篇
- 【R语言】使用nnet过程中报错Error in eval(predvars, data, env) : object ‘naulong‘ not found