解决org.hibernate.exception.SQLGrammarException:could not insert
今天在使用hibernate搭建项目时碰到了这个错误,找了好半天没能发现错误的原因,
上网求助了一下
发现出现这个bug的原因是因为数据表使用了数据库的关键字(保留字)
然后检查了一下,发现字段名称都不是关键字,那问题出现在哪呢?
再次检查发现是数据表的名字使用了数据库的关键字order
很小的一个错误因为粗心浪费了很多时间,
解决org.hibernate.exception.SQLGrammarException:could not insert的更多相关文章
- Hibernate: org.hibernate.exception.SQLGrammarException: could not insert: 错误
最近在学习Java Web,今天刚接触Hibernate.学习的书籍是<轻量级Java EE企业应用实战(第3版)>.书中367页5.2.2中给予的Hibernate例子中的代码运行有以下 ...
- Java EE 之 Hibernate异常解决:org.hibernate.exception.SQLGrammarException: could not execute statement
本质原因:配置的Java Bean,由Hibernate自动产生的SQL语句中有语法错误 原因如下: 情况1.存在字段名/表名与数据库关键字冲突 情况2.MySQL5.0以后与MySQL5.0以前事务 ...
- 用hibernate自动创建mysql表,添加失败org.hibernate.exception.SQLGrammarException
今天遇到了一个很坑人的问题,从昨晚一直搞到今天早上,终于发现了,先整理下: [背景]:利用hibernate自动给mysql创建一个表,然后为表里面添加一行记录,非常的简单(当然其中还涉及到sprin ...
- Hibernate错误:Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
报错:Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execu ...
- Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n ...
- Hibernate框架:org.hibernate.exception.SQLGrammarException: Cannot open connection at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java92)
报错信息 org.hibernate.exception.SQLGrammarException: Cannot open connection at org.hibernate.exception. ...
- org.hibernate.exception.SQLGrammarException: could not execute query
SSH项目中出现了 org.hibernate.exception.SQLGrammarException: could not execute query 错误,仔细检查后发现,是把createQu ...
- Method threw 'org.hibernate.exception.SQLGrammarException' exception. Cannot evaluate com.hotel.Object_$$_jvst485_15.toString()
数据库字段和类Object属性不匹配,Method threw 'org.hibernate.exception.SQLGrammarException' exception. Cannot eval ...
- org.hibernate.exception.ConstraintViolationException: could not insert:
org.hibernate.exception.ConstraintViolationException: could not insert: 报错原由于xxx.hbm.xml文件里的主键类型设置有问 ...
随机推荐
- 【腾讯Bugly干货分享】Android 插件技术实战总结
本文来自于腾讯Bugly公众号(weixinBugly),未经作者同意,请勿转载,原文地址:https://mp.weixin.qq.com/s/1p5Y0f5XdVXN2EZYT0AM_A 前言 安 ...
- [转载]你所不了解的DevOps
DevOps开发运维训练营 一旦建立了创新的文化,即使那些并非科学家或者工程师的人——诗人.演员.记者——也能以团体的形式,接受科学文化的意义.他们信奉创新文化的概念.他们以促进这种文化的方式投票.他 ...
- Jenkins关闭和重启实现方式.
1.关闭Jenkins 只需要在访问jenkins服务器的网址url地址后加上exit.例如我jenkins的地址http://localhost:8080/,那么我只需要在浏览器地址栏上敲下http ...
- JavaScript之DOM对象获取(1)
我们在操作html中的节点的时候,第一步就需要获取到对应节点(元素),才能有后续的操作.获取节点的方式有很多 1.document.getElementById(‘id值’) 通过id精确的选中某一个 ...
- HTML学习一_网页的基本结构及HTML简介
HTML网页的基本结构 ```angular2html<!DOCTYPE html> 声明为 HTML5 文档<html> 元素是 HTML 页面的根元素<head> ...
- Android精通之AsyncTask与ListView讲解
版权声明:未经博主允许不得转载 AsyncTask 了解AsyncTask异步,需要了解一下异步任务(多线程),什么是线程,可以这么说线程好比边吃饭边看电视,AsyncTask是为了方便后台线程中操作 ...
- Spring整合MyBatis 你get了吗?
Spring整合MyBatis 1.整体架构dao,entity,service,servlet,xml 2..引入依赖 <dependencies> <dependency> ...
- spark面试总结3
Spark core面试篇03 1.Spark使用parquet文件存储格式能带来哪些好处? 1) 如果说HDFS 是大数据时代分布式文件系统首选标准,那么parquet则是整个大数据时代文件存储格式 ...
- tensorflow 迭代周期长,每个epoch时间变慢
理论上,session启动后,每个epoch训练时间应该是差不多,而且不会因为迭代周期变长,epoch时间变慢.原因是session里定义了tf.op导致的,每一次迭代都会在graph里增加新的节点, ...
- Velocity CheckingForNull
Q: I want to check for null, something like this: #if ($car.fuel == null) A: There are several appro ...