最简单的原因可能是数据库外键字段选择了不能为空,

改为允许为空就行了。

报错org.springframework.dao.DataIntegrityViolationException的更多相关文章

  1. 报错org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet"

    org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n ...

  2. 报错:org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query

    service实现类上没有加@transaction 事务注解

  3. org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.

    今天报了这个异常,这是页面报的 org.springframework.dao.DataIntegrityViolationException: could not execute statement ...

  4. 【hibernate】报错:org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement

    报错如下: org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a ...

  5. Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误——SHH框架

    SHH框架工程,Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误 1.查看配置文件web.xml中是否配置.or ...

  6. 【异常】Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException

    Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException ...

  7. org.springframework.dao.DataIntegrityViolationException:

    数据库用的hibernate,开发工具用的myeclipse,使用开发工具连接数据库生成hibernate基于xml的po类,运行时报org.springframework.dao.DataInteg ...

  8. applicationContext.xml报错org.springframework.orm.hibernate3.LocalSessionFactoryBean not found

    applicationContext.xml报错org.springframework.orm.hibernate3.LocalSessionFactoryBean not found 解决办法: 1 ...

  9. tomcat报错org.springframework.web.context.ContextLoaderListener找不到

    tomcat报错org.springframework.web.context.ContextLoaderListener找不到. 最后解决办法:将jar包copy到web-inf下面的lib中. 你 ...

随机推荐

  1. Android——坐标系及转化

    一.坐标系 Android应用层坐标系原点在左上角,坐标范围(0,0)——(width,height). Android底层坐标系原点在屏幕中央,坐标范围(-1000,,1000)——(1000,10 ...

  2. POJ 3414:Pots

    Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11661   Accepted: 4940   Special J ...

  3. html-基本form元素---ShinePans

    <html> <meta http-equiv="content-type" content="text/html;charset=UTF-8" ...

  4. vue、react、angular三大框架对比

    前端的三大框架当属vue.react以及angular了,个人比较偏向react,它的社区比较繁荣,有很多丰富的组件 .angular的话感觉编译时间有点长,等待很恼火. vue与react vue和 ...

  5. java 获取时间戳

    //java 获取时间戳 long currentTime=System.currentTimeMillis();

  6. bzoj4105: [Thu Summer Camp 2015]平方运算

    填坑 我不知道怎么算的,但是所有环的LCM数不会超过60 然后用线段树维护这个东西,每个节点记录子树内的循环节 没到循环节的暴力枚举 复杂度是nlogn再乘以循环节长度 #include<cst ...

  7. MySQL数据库设计常犯的错以及对性能的影响

    1.过分的反范式化为表建立太多的列 我们在设计数据库的结构时,比较容易犯的第一个错误就是对表进行了过分的反范式化的设计,这就容易造成了表中的列过多,虽然说Mysql允许为一个表建立很多的列,但是由于M ...

  8. html5--6-35 列表和表格

    html5--6-35 列表和表格 实例 学习要点 掌握列表和表格的样式设置 表格有关的属性: border-collapse 设置是否把表格边框合并为单一的边框.属性值:separate 默认值/c ...

  9. ASP.NET统计图表控件

    近来客户需要将前段时间开发的统计信息用图表展示出来,还要多个图表类型,例如:柱状图.饼图.曲线图.三维图等等.在网上google了一下,发现了三个(也许更多)可以使用的控件.下面我们一起看看这三个控件 ...

  10. 获取cookie值

    function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (do ...