DataIntegrityViolationException
not-null 
你把数据库中的属性全都改为允许为空!解决问题!

解决方案 »

  1.   

    not-null property references a null or transient value
    非空属性引用了一个空的或者瞬时(游离状态)的值,可能是引用的值还没有进行持久化吧,还处于游离状态
      

  2.   

    我今天也遇到这个问题,not-null property references a null or transient value: com.accp.rpms.pojo.Hostinfo.roominfo;  是因为我Hostinfo表中引用了Roominfo表,当我在级联删除的时候,报hostinfo中的roominfo对象为null 但我己经设置了延迟加载为false 还是报错,不懂,哪位大师帮帮忙啊。
      

  3.   

    我是碰到 :org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update的错误,哪个高手帮忙下!
      

  4.   

    我是碰到 :org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update的错误,哪个高手帮忙下!
    not-null property references a null or transient value 帮忙啊
      

  5.   

    是在保存的时候保存了非空字段,如果使用了ssh的话你可以尝试把那个字段改成可为空然后hmb.xml中相应字段的not-null属性设置为false,然后把与之关联的表里面的相应的not-null属性设置为false就应该可以了
      

  6.   

    你如果是用SSH框架的话,那么,你就去Item.hbm.xml里面找
    第1步
    <property name="kind" type="java.lang.String">
             <column name="kind"  not-null="true" />
    </property>将它改为
    <property name="kind" type="java.lang.String">
             <column name="kind"  not-null="false" />
    </property>第2步,将数据库里面对应的字段,设置为允许为空。如果,你那个字段,一定要有值,那么就不用第1,2步,直接给给kind字段赋值。
      

  7.   

    如果用的是ssh框架,在Action中执行操作数据库时报这个错,检查数据库中不允许为空的值已经都是非空的,就把该action中的方法写到sevice中,就不会报错了。可能是因为事务的问题。