MyBatis There is no getter for property named ‘xxx‘ in ‘class xxx‘问题解决
问题描述:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'dataTime' in 'class com.dto.UserDto'
问题分析:
1、Mapper文件中参数出现了dataTime,但是实体类UserDto中却没有dataTime,两边无法映射导致报错。
<insert id="create">INSERT INTO t_user(user_id,user_name,data_time)VALUES (#{item.userId,item.userName,item.dataTime})</insert>
public class UserDto {private Long userId;private String userName;
}
解决办法:
(1)Mapper文件去掉dataTime,实体类保持不变。
<insert id="create">INSERT INTO t_user(user_id,user_name)VALUES (#{item.userId,item.userName})</insert>
(2)实体中添加dataTime,Mapper文件保持不变。
public class UserDto {private Long userId;private String userName;private Date dataTime;
}
旭东怪的个人空间_哔哩哔哩_Bilibili旭东怪,人生低谷不可怕,可怕的是坚持不到人生转折点的那一天;旭东怪的主页、动态、视频、专栏、频道、收藏、订阅等。哔哩哔哩Bilibili,你感兴趣的视频都在B站。https://space.bilibili.com/484264966?spm_id_from=333.1007.0.0
MyBatis There is no getter for property named ‘xxx‘ in ‘class xxx‘问题解决相关推荐
- 异常处理:Mybatis报错:There is no getter for property named ‘xxxx‘ in ‘class xxx‘
异常处理:Mybatis报错:There is no getter for property named 'xxxx' in 'class xxx' 参考文章: (1)异常处理:Mybatis报错:T ...
- Mybatis There is no getter for property named 'XXX' in 'class java.lang.XXX
Mybatis查询 使用Mybatis查询时,其参数可以是基本数据类型或者像Integer和String这样的简单的数据对象,也可以是复杂对象(一般是指JavaBean)或者map等,当使用基本数据类 ...
- mybatis There is no getter for property named 'xx' in 'class java.lang.String
用mybatis查询时,传入一个字符串传参数,且进行判断时,会报 Java代码 There is no getter for property named 'moduleCode' in 'cla ...
- mybatis There is no getter for property named '*' in 'class java.lang.String
1.原因 server层 xxxx.get("1234") map <if test="aaa != null and aaa.id != null and ...
- There is no getter for property named 'xxx' in 'class.....'
mybatis There is no getter for property named 'xxx' in 'class.....' 在确定该字段在entity中添加了get set方法之后,通常 ...
- mybatis报错There is no getter for property named '***' in 'class ***'
mybatis报错There is no getter for property named '***' in 'class ***', 检查一看是xml中映射字段拼写错误,大小写. 有的时候用插件生 ...
- Mybatis中传参包There is no getter for property named XXX in class java.lang.String
一.发现问题 <select id="queryStudentByNum" resultType="student" parameterType=&quo ...
- Mybatis问题:There is no getter for property named 'unitId' in 'class java.lang.String'
Mybatis遇到的问题 问题: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.re ...
- 关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'...
现在流行的 ssm(spring + struts2 + myBatis) 持久层的mybatis是需要配置映射器的,找了个demo连接的数据库是MySQL 于是就修改了一下弄成了连接Oracle的 ...
最新文章
- 如何让ThinkPHP支持模糊搜索
- 该网页脚本造成Internet Explorer运行速度减慢!若继续运行会更慢,至无法响应!
- linux 删除乱码的文件夹,Linux服务器删除乱码文件和文件夹的方法
- ffmpeg库编译加文字_1.编译ffmpeg库
- autocomplete自动补全,远程json数据
- 如何利用 JConsole观察分析Java程序的运行,进行排错调优(转)
- java byte to long_java 中怎样将 bytes 转换为 long 类型?
- 实时计算-多级订单金额,及下级人数
- 计算机四级笔试1,9月全国计算机等级考试四级网络工程师笔试试卷(1)
- 多臂老虎机导论(二)Stochastic Bandits
- 【分布式事务系列二】Spring事务管理器PlatformTransactionManager
- uefi下添加显卡驱动
- CAD对话框不见后要如何调出
- 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...
- 计算机专业相关的组名和口号,好的小组队名和口号(精选40个)
- MATLAB 数学应用 微分方程 时滞微分方程 dde23
- 小程序 | 微信小程序实现星级评分与星级评分展示
- Python的字符串方法join(插入间隔符)
- Web主机管理器(WHM)中如何安装SSL证书
- [乡土民间故事_徐苟三传奇]第十六回_差狗子认输吃大粪
热门文章
- 酷狗音乐逐字匹配歌词是如何做到的
- Java遍历Map集合,获取key、value等方式
- 教你如何用家里闲置的Windows电脑搭建GPU服务器炼丹(无公网IP)
- 我的个人网站——“甜果网”上线了!
- ​龙迅股份在科创板上市:募资约11亿元,赛富、深创投为股东​
- 台式计算机桌面待机时间怎么调,电脑待机时间怎么设置?电脑取消待机的设置方法...
- ue4 改变枢轴位置_[UE4蓝图][Materials]虚幻4中可互动的雪地材质完整实现(二)
- 咖啡店banner.html
- maple 假设_maple基本函数
- 第 3 课 太平天国运动(1851-1864)