1. 在处理映射 1 对 n 时,Customer类为 1, Order类为 n,对象关系映射文件中没有错误,<many to one> 也正确,表名通类名。

 但是,在执行插入时,发生两个错误:

 org.hibernate.exception.SQLGrammarException: could not execute statement
 Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 (ORDER_NAME, CUSTOMER_ID) values ('order1', 6)' at line 1

插入不了,数据库中生成了一个Customer表,但没有数据,Order表则是根本没有生成。找错误,差不多一小时没有找到,,最后改了一下表名 Customers, 程序就执行成功了,不知为何?

Hibernate 错误处理的更多相关文章

  1. idea中Hibernate错误:无法解析表

    idea中Hibernate错误:无法解析表 这种情况主要是在idea中使用hibernate自定义注解,idea无法检查数据源 this inspecton controls whether the ...

  2. Spring集成hibernate错误

    八月 25, 2016 7:55:31 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule ...

  3. hibernate 错误 could not determine type for

    今天配置实体类注解时,出现以下错误: org.hibernate.MappingException: Could not determine type for: com.oneToOne.IdCard ...

  4. Hibernate错误:javax/persistence/EntityListeners

    1. 原文地址:http://heavengate.blog.163.com/blog/static/20238105320127291018026/ 错误信息: hibernate:javax/pe ...

  5. Hibernate错误——No row with the given identifier exists

    错误 是用的是Hibernate自动建立的数据表,在进行数据库操作时,出现错误No row with the given identifier exists 解决 关系数据库一致性遭到了破坏,找到相关 ...

  6. hibernate错误提示

    2016-05-03 09:45:03,275 -- WARN  -- org.hibernate.internal.util.xml.DTDEntityResolver.resolveEntity( ...

  7. 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 ...

  8. Hibernate错误:Could not bind factory to JNDI

    使用hibernate时,将hibernate.cfg.xml中 <session-factory name="SessionFactory">的那么属性去掉即可.因为 ...

  9. Hibernate错误及解决办法

    1.Hibernate 报错:this project is not a myeclipse hibernate project . assuming hibernate 3 cap res:项目名上 ...

随机推荐

  1. 认识Service

    Service相对于Activity可在后台运行,五显示界面,在activity退出的情况下仍能运行. 一.新建一个空的工程,命名为learnService 二.新建一个service,并添加如下所示 ...

  2. you don't have permission to view it 解决

    the file couldn't be opened because you don't have permission to view it   简单设置下面的选项即可,不要谢我啊! change ...

  3. ctrl+enter提交留言

    <!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8&qu ...

  4. C#_抓包HttpWebRequest跟HttpWebResponse

    1.第一招,根据URL地址获取网页信息  这招是入门第一式, 特点: 1.最简单最直观的一种,入门课程. 2.适应于明文,无需登录,无需任何验证就可以进入的页面. 3.获取的数据类型为HTML文档. ...

  5. listview去掉底部多出的边框黑色

    listview去掉底部多出的边框黑色 android:fadingEdge="none" //去掉listview黑色底边 listview.setDivider(null);

  6. iOS 静态类库 打包 C,C++文件及和OC混编

    iOS 静态类库 编译 C,C++ 我们都知道,OC 原生支持C, 在 创建的 OC类的 .m 里面,可以直接编写C的代码: 同样 Xcode 也支持 OC ,C++的混编,此时,我们通常把OC创建的 ...

  7. React Native For Android 架构初探

    版权声明:本文由王少鸣原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/171 来源:腾云阁 https://www.qclo ...

  8. java 多线程5(创建方式)

    实现Runnable接口: 问题1:Runnable实现类的对象是线程对象吗? 答:不是,该对象只不过是实现了Runnable接口的对象而已,只有是Thread或Thread的子类才是线程对象. 问题 ...

  9. 【转】 Linux下的多线程编程

    作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/原文链接:http://www.cnblogs.com/gnuhpc/archive/2012/12/07/280 ...

  10. 资源 之 4.4 Resource通配符路径(拾贰)

    4.4.1  使用路径通配符加载Resource 前面介绍的资源路径都是非常简单的一个路径匹配一个资源,Spring还提供了一种更强大的Ant模式通配符匹配,从能一个路径匹配一批资源. Ant路径通配 ...