【报错信息】
20190705 10:53:37.449 [http-apr-8080-exec-7] WARN org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:77) - SQL Error: 1064, SQLState: 42000
20190705 10:53:37.450 [http-apr-8080-exec-7] ERROR org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:78) - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''TK' as column23_47_, dimensionr0_.`USEOR` as USEOR24_47_, dimensionr0_.'USETIME' at line 1
【错误原因】
类中字段的定义时:
/**
* 查询结果耗时
*/
@Column(name = "'USETIME'")
private long useTime;
//Column 中字段 符号应该是`` 而不是''
本文详细解析了在使用Hibernate框架时遇到的SQL语法错误,特别是关于字段定义中符号使用的常见误区,通过具体案例展示了如何正确地使用反引号(`)而非单引号('')来标识字段名。
2451

被折叠的 条评论
为什么被折叠?



