当前位置:网站首页>请求数据库报错:“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就可以了。
边栏推荐
- MySQL master-slave configuration
- 1111 online map (30 points)
- [backtrader source code analysis 5] rewrite several time number conversion functions in utils with Python
- Go practice -- gorilla / websocket used by gorilla web Toolkit
- The IntelliJ platform completely disables the log4j component
- Web APIs exclusivity
- [research materials] the fourth quarter report of the survey of Chinese small and micro entrepreneurs in 2021 - Download attached
- ES7 easy mistakes in index creation
- Differences among bio, NiO and AIO
- Promise
猜你喜欢
Source insight garbled code solution
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached
JQ style, element operation, effect, filtering method and transformation, event object
穀歌 | 蛋白序列的深度嵌入和比對
[practical project] autonomous web server
Technical analysis of qianyuantong multi card aggregation router
appium1.22.x 版本後的 appium inspector 需單獨安裝
leetcode452. Detonate the balloon with the minimum number of arrows
JS scope
Webrtc protocol introduction -- an article to understand ice, stun, NAT, turn
随机推荐
Problems encountered in fuzzy query of SQL statements
Silent authorization login and registration of wechat applet
appium1.22. Appium inspector after X version needs to be installed separately
音频焦点系列:手写一个demo理解音频焦点与AudioMananger
【实战项目】自主web服务器
RT thread flow notes I startup, schedule, thread
Bluebridge cup real topic 2020 palindrome date simulation construction provincial competition
Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)
Introduction to webrtc protocol -- an article to understand dtls, SRTP, srtcp
Go practice -- gorilla/rpc (gorilla/rpc/json) used by gorilla web Toolkit
Botu uses peek and poke for IO mapping
Redis 入门和数据类型讲解
Promise
50 practical applications of R language (36) - data visualization from basic to advanced
Interface frequency limit access
JS string and array methods
Technical analysis of qianyuantong multi card aggregation router
JS function algorithm interview case
微服务常见面试题
聊聊如何利用p6spy进行sql监控