[SSM]There is no getter for property named 'token_exptime' in 'class com.hdu.model.Student'
来源:互联网 发布:nba2konline刷精华软件 编辑:程序博客网 时间:2024/04/29 06:34
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'
- There is no getter for property named 'itmesCustom' in 'class com.ssm.po.Ite
- There is no getter for property named 'xxx' in 'class com.xuezhixin.mls.web.model.yyy
- There is no getter for property named 'depart' in 'class com.xuezhixin.mls.web.model.Major'
- There is no getter for property named 'user' in 'class com.gao.model.Message
- 关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'
- There is no getter for property named 'xxx' in 'class.....'
- Mybatis-异常-There is no getter for property named 'VARCHAR' in 'class com.xxx.xxxxx
- There is no getter for property named 'value' in 'class com.hl.myabtis.first.beas.User'
- There is no getter for property named 'ypxxCustom'in'class com.onespace.ypcg.pojo.GysypmlQueryVo'
- bug解决:There is no getter for property named 'new_driver_id' in 'class com.bjw.entity.Driver'
- SSM框架分页的时候报错 There is no getter for property named 'xx' in 'class java.lang.String
- [Debug]There is no getter for property named '__frch_item_0' in
- There is no getter for property named 'id' in 'clas
- There is no getter for property named '**' in 'class java.lang.String
- mybatis There is no getter for property named 'xx' in 'class java.lang.String
- Mybatis中传参包There is no getter for property named 'XXX' in 'class java.lang.String'
- There is no getter for property named 'xxxx' in 'class java.lang.Integer
- Git 配置用户名、密码
- ECMAScript6笔记:Proxy和Reflect
- 深刻理解JavaScript基于原型的面向对象
- 算法学习-链表的部分翻转
- Mybatis 的分页插件PageHelper-4.1.1的使用
- [SSM]There is no getter for property named 'token_exptime' in 'class com.hdu.model.Student'
- 1059: [ZJOI2007]矩阵游戏 二分图匹配
- 1662: [Usaco2006 Nov]Round Numbers 圆环数 Time Limit: 5 Sec Memory Limit: 64 MB Submit: 337 Solved:
- 安卓自定义View——(一:RaiseNumberAnimTextView 带数字增长动画的TextView)
- MySQL聚合函数Group by理解
- 图片 与base64相互转换
- git-submodule应用
- Jsoup 处理 html 片段<script> 内容转义,js转换成一行问题
- html px em pt长度单位(像素 相对长度 点)知识篇