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

并且提示某个字段  not—null;

解决,查看了数据库字段类型为number类型,将生成的po对应字段改写成Integer类型,原因:开发工具生成的类型,与数据库number类型对象,但是如果数据是0会被过滤,

而Integer数据int的包装类型,不会过滤0

那么,问题解决了;

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

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

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

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

  3. 【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 ...

  4. 报错org.springframework.dao.DataIntegrityViolationException

    最简单的原因可能是数据库外键字段选择了不能为空, 改为允许为空就行了.

  5. javaEE-----org.springframework.dao.InvalidDataAccessApiUsageException: Write operation

    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read ...

  6. org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [41] did not match expected type [java.lang.Integer (n/a)];

    题记:以前记录过一些自己遇到的BUG,这个行为,让我一看报错的提示信息就能定位到问题的所在,后来记得比较多了,好多是重复性的再加上比较忙就没有详细的记录了,今天的工作量比较小,就顺便记录一下,以便以后 ...

  7. org.springframework.dao.InvalidDataAccessApiUsageException:The given object has a null identifi的解决方案

    异常信息: org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identi ...

  8. org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode

    [spring]:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowe ...

  9. OpenSessionInViewFilter与org.springframework.dao.InvalidDataAccessApiUsageException

    报错:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in r ...

随机推荐

  1. 问题(the question)

    I want to know: 1. 软件开发最主要的目的 是什么? 2. 软件开发是否同样需要模,和架构? 3.软件开发与其他程序的需求分析是否相似,有什么不同之处? 4.软件开发最常用的计算机语言 ...

  2. Java虚拟机各内存区域的位置及功能的介绍

    Java虚拟机运行时数据区: 相关区域介绍: 程序计数器: 功能:当前线程所执行字节码的行号指示器.若是Java方法记录指令地址,若为Native方法,则不记录 隔离性:线程隔离 Error:无 Ja ...

  3. SQL模仿Split 功能

    --方法0:动态SQL法 declare @s varchar(100),@sql varchar(1000) set @s='1,2,3,4,5,6,7,8,9,10' set @sql='sele ...

  4. servlet配置restful

    所需jar包如下,jar下载地址如下http://download.csdn.net/detail/zhouminglan1992/9730354 1.web.xml配置 <!--给servle ...

  5. Visual Studio命令行工具

    devenv.exe Visual Studio IDE 主程序,位于VS_INSTALL_DIR/Common7/IDE. 本节内容来源:vs2010环境执行devenv /? 启动VS deven ...

  6. HTTP Header

    1.User-Agent 记录访问当前网页的用户浏览器类型和版本,操作系统类型和版本.常见场景:根据不同浏览器和版本提供不同站点. JavaScript通过window.navigator.userA ...

  7. Linux下解压命令大全 解压缩 tar bz2 zip tar.gz gz

    .tar解包:tar xvf FileName.tar打包:tar cvf FileName.tar DirName(注:tar是打包,不是压缩!)---------------.gz解压1:gunz ...

  8. UPDATE INNER JOIN 两表联合更新

    UPDATE B_READMETER_HANDWORK INNER JOIN B_READMETER_ORDER_SP ON B_READMETER_HANDWORK.ID = B_READMETER ...

  9. iOS9 适配(杂七杂八)

    1.iOS9 以后,table cell 在旋转的时候会自动调整视图内容的布局,设置以下的属性,课禁止该行为. if (runTimeOSVersion >= 9.0f) { _listTabl ...

  10. 基于ssh框架开发的购物系统的质量属性

    根据前面的博客,我们已经大致了解了ssh架构开发整体概念:Struts是一个实现了MVC模式的经典的框架:Hibernate是轻量级Java EE应用的持久层解决方案,以面向对象的方式提供了持久化类到 ...