Hibernate 错误处理
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 错误处理的更多相关文章
- idea中Hibernate错误:无法解析表
idea中Hibernate错误:无法解析表 这种情况主要是在idea中使用hibernate自定义注解,idea无法检查数据源 this inspecton controls whether the ...
- Spring集成hibernate错误
八月 25, 2016 7:55:31 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule ...
- hibernate 错误 could not determine type for
今天配置实体类注解时,出现以下错误: org.hibernate.MappingException: Could not determine type for: com.oneToOne.IdCard ...
- Hibernate错误:javax/persistence/EntityListeners
1. 原文地址:http://heavengate.blog.163.com/blog/static/20238105320127291018026/ 错误信息: hibernate:javax/pe ...
- Hibernate错误——No row with the given identifier exists
错误 是用的是Hibernate自动建立的数据表,在进行数据库操作时,出现错误No row with the given identifier exists 解决 关系数据库一致性遭到了破坏,找到相关 ...
- hibernate错误提示
2016-05-03 09:45:03,275 -- WARN -- org.hibernate.internal.util.xml.DTDEntityResolver.resolveEntity( ...
- 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 ...
- Hibernate错误:Could not bind factory to JNDI
使用hibernate时,将hibernate.cfg.xml中 <session-factory name="SessionFactory">的那么属性去掉即可.因为 ...
- Hibernate错误及解决办法
1.Hibernate 报错:this project is not a myeclipse hibernate project . assuming hibernate 3 cap res:项目名上 ...
随机推荐
- C++——将成员函数作为参数
在C++中,成员函数指针作为参数传递给其他函数和普通函数指针的传递是不同的,首先 我们来回顾一下普通函数指针的传递方法: //------------------------------------- ...
- C++—函数探幽
一.内联函数 1.内联函数的机制 内联函数是C++为提高程序运行速度而做的一项改进. 函数调用机制:常规函数调用使程序使程序跳到被掉函数的地址,并在函数结束时返回. 内联函数的机制:内联函数的代码与其 ...
- OpenGL的几何变换3之内观察全景图
继续上一篇文章的例子:OpenGL的几何变换2之内观察立方体 上一篇是通过绘图方式得到的立方体,没有贴图,这次加上纹理贴图. 通过纹理贴图有两种方案: 1.图片分割化,即是把一张完整的全景图片(就是支 ...
- python linux 磁盘操作
#coding:utf-8 ''' __author__ = 'similarface' connection:841196883@qq.com 磁盘操作 ''' import psutil impo ...
- 能在CAD2004以下版本里面打开2007以上版本文件的外挂
下载地址:http://yunpan.cn/cjrxMKNubXQ5E 访问密码 1974 老何CAD工具安装办法:[推荐]先安装老何工具箱,然后用[扩展添加老何cad下拉菜单.bat]就完成老何下 ...
- 【Unity Shaders】初探Surface Shader背后的机制
转载请注明出处:http://blog.csdn.net/candycat1992/article/details/39994049 写在前面 一直以来,Unity Surface Shader背后的 ...
- JavaScript:闭包
根据MDN上的解释『闭包是指函数有自由独立的变量.换句话说,定义在闭包中的函数可以“记忆”它创建时候的环境.』 闭包有两个主要的作用: 1.访问内部函数的局域变量: 2.将创建的变量永久保存在内存中, ...
- Qt之Meta-Object系统
简述 Qt的元对象系统(Meta-Object System)提供了信号与槽机制,可用于对象间通信.运行时类别信息和动态属性系统. 元对象系统基于三个方面: QObject类:为objects提供了一 ...
- kwicks插件学习
/* Kwicks for jQuery (version 1.5.1) Copyright (c) 2008 Jeremy Martin http://www.jeremymartin.name/p ...
- IO流--复制picture ,mp3
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileInputStream; import ...