报错如下图所示:

报错原因:在配置文件或注解里设置了字段关联,但数据却没有关联。

解决方法:我的错误是向一个多对多的关联表里插入数据,由于表中一个字段的数据是从另一张表里get到的,通过调试发现,从以一张表里没有get到此数据,所以在添加时由于此字段没有获取到数据,所以无法与另一字段关联插入表里。通过修改使关联数据都能获取到值。

hibernate添加数据报错:Could not execute JDBC batch update的更多相关文章

  1. Hibernate 抛出的 Could not execute JDBC batch update

    异常堆栈 org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at or ...

  2. 严重: Could not synchronize database state with session org.hibernate.exception.DataException: Could not execute JDBC batch update

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #ff2600 } p.p2 { margin: 0.0px 0 ...

  3. exception is org.hibernate.exception.DataException: Could not execute JDBC batch update at

    没有什么问题,但是却报了Could not execute JDBC batch update的错,主要是配置文件设置了关联,数据却没有关联造成的,只要数据正确就没有问题. 另外,造成这个原因的还可能 ...

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

  5. hibernate 级联删除报更新失败的问题(org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update)

    首先hibernate级联删除的前提是,首先需要在映射文件中配置,配置多表之间的关联关系: 下面以部门表(Dept)和员工表(Emp)为例: 1.在Emp.hbm.xml映射文件中配置many-to- ...

  6. Could not execute JDBC batch update; SQL [delete from role where roleId=?]; constraint [null]; neste

    今天在写多个删除功能的时候出现了这么一个错误:意思是删除操作的时候,没有找到对应的外键. Cannot delete or update a parent row: a foreign key con ...

  7. hibernate的Could not execute JDBC batch update错误原因及处理

    http://blog.csdn.net/derpvailzhangfan/article/details/2332795\ 上述问题: 一设置关联 二包含关键字 三 映射文件设置 catalog=“ ...

  8. Hibernate更新数据报错:a different object with the same identifier value was already associated with the session: [com.elec.domain.ElecCommonMsg#297e35035c28c368015c28c3e6780001]

    使用hibernate更新数据时,报错 Struts has detected an unhandled exception: Messages: a different object with th ...

  9. dajngo控制台添加数据报错Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured.

    报错: django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but set ...

随机推荐

  1. label 和input/textarea居中对齐

    设置label和input/textarea的vertical-align: middle;即可实现垂直方向居中对齐.有时候可能会有偏差,设置input的margin-top使看上去居中对齐

  2. 【go语言实现服务器接收http请求以及出现泄漏时的解决方案】

    一.关于基础的程序的实现 刚开始的时候程序是这样实现的: // Hello package main import ( "database/sql" "fmt" ...

  3. 项目总结08:spring quartz 定时器Demo

    将定时器用到的quartz.jar放在lip文件下 quartz.xml文件(完整) <?xml version="1.0" encoding="UTF-8&quo ...

  4. 【校招面试 之 网络】第2题 TCP的可靠传输、流量控制、滑动窗口

    1.可靠传输 (1)三次握手 TCP/IP协议中,TCP协议提供可靠的连接服务,采用三次握手建立一个连接: (1)第一次握手:建立连接时,客户端A发送SYN包(SYN=j)到服务器B,并进入SYN_S ...

  5. 关于viewport我自己的理解

    其实即使不在html中添加meta viewport标签,每个移动端浏览器都会有一个默认的viewport,只是这个viewport的宽度是980,然后做1:3或者1:2的自动缩放.所以当不在html ...

  6. Linux下的crontab定时执行任务详解

    在LINUX中,周期执行的任务一般由cron这个守护进程来处理[ps -ef|grep cron].cron读取一个或多个配置文件,这些配置文件中包含了命令行及其调用时间.cron的配置文件称为“cr ...

  7. mysql中left join设置条件在on与where时的区别

    一.首先我们准备两张表来进行测试. CREATE TABLE `a` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `na ...

  8. go语言net包udp socket的使用

    udp与tcp的不同在于客户端请求方式不同,udp缺少Accept函数. 一个简单的udp客户端: package main; import ( "net" "log&q ...

  9. VS2013中Nuget程序包管理器控制台使用入门(三)-项目实战(原创)

    VS2013中Nuget程序包管理器控制台使用入门(三)-项目实战 1.给指定项目安装Newtonsoft.Json ,Version 4.5.11 PM> Install-Package Ne ...

  10. ceil,floor,trunc,round,sign几个函数在SQL的使用方法

    只是在oracle的环境下进行的几个数的测试,在这里只是举例说明,没有理论说明,抱歉. select ceil(1.8) from dual; --结果为1,向上取整select floor (1.8 ...