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. 图标下载网站 http://www.easyicon.net/

    图标下载网站 http://www.easyicon.net/

  2. go语言中间的循环

    在Go语言中只有很少的几个控制结构,它没有while或者do-while循环. 但是它有for.switch.if.而且switch接受像for那样可选的初始化语句.下面来认识一下他们 一.if语句 ...

  3. Mybatis3+Spring4+SpringMVC4 整合

    首先在整合这个框架的时候,想想其一般的步骤是怎样的,先有个步骤之后,不至于在后面的搞混了,这样在整合的时候也比较清晰些. 然后我们就细细的一步一步来整合. 1  创建一个Web项目. 2  导入Myb ...

  4. Hbase之Exception

    [hadoop@master hbase-1.2.2]$ ./bin/hbase shell2016-08-25 13:53:56,898 WARN [main] util.NativeCodeLoa ...

  5. commonJS — 对象操作(for Object)

    for Object github: https://github.com/laixiangran/commonJS/blob/master/src/forObject.js 代码 /** * Cre ...

  6. phalcon: 视图分层渲染,或包含其他页面

    一:视图分层显现: 比如:在一个页面中,头部.底部固定不变,只有中间部分随操作变换显示.那么可以将中间部分切出来,剩余部分用作固定框架,放入:app/views/layouts目录中,起名为:base ...

  7. R统计建模与R软件

    教材目录 第一章 概率统计的基本知识 第二章 R软件的使用 第三章 数据描述性分析 第四章 参数估计 第五章 假设检验 第六章 回归分析 第七章 方差分析 第八章 应用多元分析(I) 第九章 应用多元 ...

  8. js生成验证码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. python 练习 5

    #!/usr/bin/python # -*- coding: utf-8 -*- from collections import deque def z69(): '''猜牌术(1) 魔术师,最上面 ...

  10. WPF: DatePicker

    获取DatePicker:date_Start上显示的时间date_Start.SelectedDate 比较两个dateTime类型的时间: DateTime StartDate =Convert. ...