org.hibernate.exception.SQLGrammarException:could not insert:问题解决
来源:互联网 发布:linux凝思重启网卡命令 编辑:程序博客网 时间:2024/05/21 03:58
今天做SHH的整合,在做底层Hibernate与数据库连接的过程中,运行测试类,
遇到了org.hibernate.exception.SQLGrammarException:could not insert:的问题
控制台显示了SQL代码,但是数据库中没有插入一条数据,
在网上查找有说是数据库表中字段名与Hibernate关键字重复的,
仔细检查报错代码发现是控制台中显示的|SQL语句中的字段与数据库中的字段不一致所致,
添加了实体类的别名注解后问题解决!!!
一定要注意:当数据库中的字段与实体类中的字段名不一致时,实体类的每个字段上一定要添加别名注解!!!
例如:@Column(name="c_add")
阅读全文
0 0
- org.hibernate.exception.SQLGrammarException:could not insert:问题解决
- org.hibernate.exception.SQLGrammarException: could not insert:
- org.hibernate.exception.SQLGrammarException: could not insert:
- org.hibernate.exception.SQLGrammarException: could not insert
- Hibernate: org.hibernate.exception.SQLGrammarException: could not insert: 错误
- 关于org.hibernate.exception.SQLGrammarException: could not insert:
- org.hibernate.exception.SQLGrammarException: could not insert:XXX解决
- org.hibernate.exception.SQLGrammarException: could not insert……
- “org.hibernate.exception.SQLGrammarException: could not insert...”解决方法
- 关于org.hibernate.exception.SQLGrammarException: could not insert
- 数据库错误org.hibernate.exception.SQLGrammarException:could not insert
- hibernate.exception.SQLGrammarException异常:could not insert、
- hibernate出现异常org.hibernate.exception.SQLGrammarException:could not execute
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
- org.hibernate.exception.SQLGrammarException: could not execute query
- [编程题] 涂棋盘
- SpringBoot利用redis集成消息队列
- 卷积神经网络的一些改进操作
- mac下安装git后提示安装xcode
- 后台返回json,前台接收有问题
- org.hibernate.exception.SQLGrammarException:could not insert:问题解决
- 8-29 DAIRY
- VS软件的日常
- Python 踩坑记录
- CCF考试练习——201612-1
- 从瓶颈到精通——Android四大组件:Activity
- pl/sql重复记录处理
- STL算法(1) C++ 查找算法
- BuildAsset-场景测试