当前位置:网站首页>请求数据库报错:“could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGram
请求数据库报错:“could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGram
2022-07-03 05:16:00 【YTIANYE】
报错信息
IDEA提示:
java.sql.SQLSyntaxErrorException: 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 orderpo0_ where orderpo0_.id is not null'
访问API返回结果:
{
"status": 500,
"error": "Internal Server Error",
"message": "could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet",
}
解决方法:
查询一些解决方案大多是数据库表修改后,与Java的类名称不对应,驼峰命名在数据库表中转为下划线方式,但是我的字段命名没有错误。
@Data
@Entity
@Table(name = "order")
public class OrderPO {
@Id
@GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator")
@GeneratedValue(generator = "uuid2")
String id;
String customerId;
String customerName;
String packageId;
String packageName;
String modules;
String securityGroupRuleId;
}
后来发现是因为数据库的表名包含关键字,我的表命名为了order,改为order_form就可以了。
边栏推荐
- Wechat applet distance and map
- [clock 223] [binary tree] [leetcode high frequency]: 102 Sequence traversal of binary tree
- Notes | numpy-07 Slice and index
- RT thread flow notes I startup, schedule, thread
- appium1.22. Appium inspector after X version needs to be installed separately
- Interview question -- output the same characters in two character arrays
- "Pthread.h" not found problem encountered in compiling GCC
- Messy change of mouse style in win system
- Based on RFC 3986 (unified resource descriptor (URI): general syntax)
- Detailed explanation of the output end (head) of yolov5 | CSDN creation punch in
猜你喜欢
JS scope
SSM framework integration
(subplots usage) Matplotlib how to draw multiple subgraphs (axis field)
Yolov5 network structure + code + application details | CSDN creation punch in
leetcode435. Non overlapping interval
酒店公共广播背景音乐-基于互联网+的酒店IP网络广播系统设计
Compile and decompile GCC common instructions
"250000 a year is just the price of cabbage" has become a thing of the past. The annual salary of AI posts has decreased by 8.9%, and the latest salary report has been released
穀歌 | 蛋白序列的深度嵌入和比對
Coordinatorlayout appbarrayout recyclerview item exposure buried point misalignment analysis
随机推荐
Webapidom get page elements
Yolov5 network structure + code + application details | CSDN creation punch in
Detailed explanation of yolov5 training own data set
大学校园IP网络广播-厂家基于校园局域网的大学校园IP广播方案设计指南
1103 integer factorization (30 points)
Shuttle + alluxio accelerated memory shuffle take-off
Pessimistic lock and optimistic lock of multithreading
Notes | numpy-07 Slice and index
Differences among bio, NiO and AIO
Without 50W bride price, my girlfriend was forcibly dragged away. What should I do
微服务常见面试题
Pan details of deep learning
【批处理DOS-CMD命令-汇总和小结】-CMD窗口的设置与操作命令-关闭cmd窗口、退出cmd环境(exit、exit /b、goto :eof)
【实战项目】自主web服务器
2022-02-11 daily clock in: problem fine brush
Overview of basic knowledge of C language
[research materials] 2021 China's game industry brand report - Download attached
动态规划——相关概念,(数塔问题)
Handler understands the record
[research materials] 2022q1 game preferred casual game distribution circular - Download attached