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. Android布局_网格布局GirdLayout

    自Android4.0版本后新增的GirdLayout网格布局(API 14) <?xml version="1.0" encoding="utf-8"? ...

  2. HTML的超链接

    一.超链接概念: 超链接也叫 URL 中文翻译为资源定址器.这个定址器的功能主要告诉浏览器根据 URL的地址找到所需的资源.作用于连接资源 二.超链接的常用属性: 1.href=指定目的地,当有了hr ...

  3. MapReduce中作业调度机制

    MapReduce中作业调度机制主要有3种: 1.先入先出FIFO      Hadoop 中默认的调度器,它先按照作业的优先级高低,再按照到达时间的先后选择被执行的作业. 2.公平调度器(相当于时间 ...

  4. Druid 数据库用户密码加密 代码实现

    druid-1.0.16.jar 阿里巴巴的开源数据连接池 jar包 明文密码+私钥(privateKey)加密=加密密码 加密密码+公钥(publicKey)解密=明文密码 程序代码如下: pack ...

  5. MYSQL 编码方式 ------导入 .sql 文件 报编码错误

    在做计量泵上位机时,利用MYSQL存储数据,建表hisruninfo(计量泵历史运行数据表). 表格式为utf8,查过数据库 格式 同样为utf8 导入该hisruninfo.sql文件时,并没有报错 ...

  6. java 抽象类

    抽象类: 1)函数没有方法体,就必须用abstract修饰. 2)抽象函数所在的类必须也是抽象的. 3)非抽象的类继承于抽象类,必须实现其全部方法. 4)抽象类中可以存在抽象方法,也可以不存在. 5) ...

  7. 精简android4.2

    cd /system/apprm YouTube.*rm Settings.*rm VoiceDialer.*rm Phone.*rm QuickSearchBox.*rm RSSReader.*rm ...

  8. C++编译错误cannot have cv-qualifier

    C++编译错误cannot have cv-qualifier 在C++中CV指const和volatile两个关键字.有两种情况不能使用CV限定. 一.非成员函数不能含有CV限定,即const和vo ...

  9. 【转】commons-lang.jar包简介

    转自:http://zhidao.baidu.com/share/71b48e6b3e1b1dc73fe705604b9c7584.html 1.下载jar包 包官方下载地址:http://commo ...

  10. MATLAB 损失函数画图

    损失函数画图 Hinge loss function: \[H(z) = max(0,1-z)\] $\psi$-learning loss function: \[{\phi _s}(z) = \l ...