0
点赞
收藏
分享

微信扫一扫

【JavaEE领域】com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mp.employee' doesn't exi

十日十月Freddie 2022-02-20 阅读 73


com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mp.employee' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

使用mybatis-plus进行数据的添加,出现了上诉问题。

原因是:Mybatis-plus会默认使用实体类的类名到数据中找对应的表

表名是:tb_employee

但是实体类的类名是Employee

因此在实体类上添加上

@TableName(value = "tb_employee")

就可以了。


举报

相关推荐

0 条评论