解决:Mybatis-plus中的BaseMapper中的insert方法报错
Mybatis-plus中的BaseMapper中的insert方法报错报错如下Caused by: org.apache.ibatis.exceptions.PersistenceException:### Error updating database.Cause: java.lang.ClassCastException: com.xxxx.xxx.xx.Entity cannot be c
·
Mybatis-plus中的BaseMapper中的insert方法报错
报错如下
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.ClassCastException: com.xxxx.xxx.xx.Entity cannot be cast to com..xxxx.xxx.xx.Entity
### Cause: java.lang.ClassCastException: com.office.platform.sys.entity.SysUserEntity cannot be cast to com.office.platform.sys.entity.SysUserEntity
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
... 130 more
去掉pom文件中的devtools即可
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
官网貌似也没记录这个错误,大家有兴趣可以去看一下官网的文档
链接: 传送门.
更多推荐
已为社区贡献2条内容
所有评论(0)