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自动接听&挂断电话(包含怎么应对4.1以上版本的权限检

    一  前言 这两天要研究类似白名单黑名单以及手势自动接听的一些功能,所以呢,自然而然的涉及到怎么自动接听/挂断电话的功能了.对于自动接听这一块,android4.1版本及其以上的版本和之前的版本处理逻 ...

  2. Android 新手引导

    关于这个Demo的写法很多 我也献上一段 效果图如下 上代码 MainActivity public class MainActivity extends Activity { // public L ...

  3. iOS--获取输入字符的第一个字母(汉字则获取拼音的第一个字母)

    - (NSString *)firstCharactor:(NSString *)aString { //转成了可变字符串 NSMutableString *str = [NSMutableStrin ...

  4. D3.js 第一个程序 HelloWorld

    一.HTML 是怎么输出 HelloWorld 的 <html> <head> <meta charset="utf-8"> <title ...

  5. mybatis动态sql中where标签的使用

    where标记的作用类似于动态sql中的set标记,他的作用主要是用来简化sql语句中where条件判断的书写的,如下所示: <select id="selectByParams&qu ...

  6. angular-file-upload 中文API

    github地址: https://github.com/nervgh/angular-file-upload Directives(指令) nv-file-drop <!-- 最少配置 --& ...

  7. 腾讯云centos 7部署 dotnetcore+Angular2 实践

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

  8. bzoj题解汇总(1001-1016)

    bzoj1001: 平面图网络流. 注意只有一行或者一列的情况. bzoj1002: 待定系数法求解递归式.或者用MatrixTree+行列式直接推导. 然后来个高精度. bzoj1003: dp+最 ...

  9. Ubuntu 系统下 mongodb 安装和配置

    安装 MongoDB sudo apt-get install mongodb sudo apt-get install mongodb 关闭/启动 sudo service mongodb stop ...

  10. 批量Load/Store指令的寻址方式

    批量Load/Store指令用于实现在一组寄存器和一块连续的内存单元之间传输数据.也称为多寄存器寻址方式,即一条指令可以完成多个寄存器值的传送.这种寻址方式可以用一条指令最多完成传送16个通用寄存器的 ...