表字段与mysql关键字冲突

时间:2020-12-29 12:06:59   收藏:0   阅读:0

项目启动提示语法错误
[42000][1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘persist,

检查发现,表字段中有个persist字段,和mysql关键字冲突
解决该问题,需要在查询的时候,字段名带上反引号,用的是mybatis-plus,所以在对应实体类的字段加上注解即可

@TableField("`persist`")
private Integer persist;

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!