org.hibernate.exception.SQLGrammarException: could not inYou have an error in your SQL syntax;完美解决错误

来源:互联网 发布:网络脱机状态怎么解除 编辑:程序博客网 时间:2024/05/16 17:27
错误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 'order orders0_ where orders0_.userid=22' at line 1你是否运行你的项目的时候报这个错误,这个错误并不是因为你的代码出现错误了,而是因为你实体层与数据库字段出现问题了,实体层跟数据库各个字段都要一一对应,还有可能使因为carmessage与car_message另你的字段出现问题,一定要都尝试一下。本博主的方法亲测过,在百度上也搜了很多解决办法,还有的居然说是字符集编码的问题,我试过,跟字符集编码没关系。最重要就是要看清楚实体层跟数据库字段一定要一一对应,细心点就不会错,或者使用逆向工程,保证不会错误。
0 0
原创粉丝点击