[hibernate]org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter

org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.wa.dataprocess.query.model.AcrossDeptApply

包装类和基本数据类型的区别,

包装类默认为null,基本类型为0.

public class AcrossDeptApply implements Serializable

private String applyReason;//申请原因
    private String  status;//是否撤销申请  0
    private long applyUserId

//......getter ,setter
   }

将基本类型的long改为包装类Long即可解决上述异常。

时间: 2024-11-10 16:06:20

[hibernate]org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter的相关文章

org.hibernate.PropertyAccessException:Null value was assigned to a property of primitive type setter

在项目开发中遇到下面的异常:org.hibernate.PropertyAccessException:Null value was assigned to a property of primitive type setter ofcom.atguigu.surveypark.model.Page.orderno 这个异常的解释是:      Null值被分配给了设置为基本类型的Page类里的orderno属性.也就是说Null是不能分配给基本数据类型的.解决办法:手动给数据库中是Null值的

org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of 异常

在开发项目的过程中,发现如下异常: 原因是updateType字段为int类型,不能接收null,而在数据库中对应的字段为null,解决方法:将updateType字段类型改为Integer.

hibernate.PropertyAccessException: Null value was assigned to a property of primitive type

日志: [WARN-2016/07/26/18/:45/:52]ProcessEngineServiceImpl.(257) - 审批流程log日志--submitProcess方法:提交人userId:3333333349,TaskId:245959,ProcInstId:null,WfInstaceId:16583386853,当前时间:Tue Jul 26 18:45:52 CST 2016 [ERROR-2016/07/26/18/:45/:52]ProjectRepayControll

Null value was assigned to a property of primitive type setter

org.springframework.orm.jpa.JpaSystemException: Null value was assigned to a property of primitive type setter of com.eshore.ismp.order.entity.HandSiOrder.siSize; nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a

Null value was assigned to a property of primitive type setter of cn.itcast.oa.domain.Forum.topicCount

[引用http://m.blog.csdn.net/blog/u013998070/41087351] Null value was assigned to a property of primitive type setter of cn.itcast.oa.domain.Forum.topicCount 2014-11-13阅读376 评论0 最近做一个OA项目,其中有一个论坛管理的版块,起初在实体类Forum只有几个字段,在数据库中也有对应的数据,在页面显示时,完全没有任何问题:但是后来在

org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type sette

org.hibernate.PropertyAccessException: Null value was assigned to a property <property column="sex"  name="sex"  type="java.lang.Boolean"/> JavaBean修改:private Boolean sex; 原因:数据库字段值为NULL,int 类型不能赋值为NULL,只能为0,但有些实际应用中,如学

Null value was assigned to a property of primitive type setter of&quot;原因及解决方法

原文:http://blog.csdn.net/kevinzhangfei/article/details/6995316 总结:在Java中使用大写的数据类型. 在action请求数据的过程中报出"Null value was assigned to a property of primitive type setter of"错误,搜索之后发现是因为数据库里相应的字段为NULL. 例如: Java代码 <!--Hibernate映射文件中的字段--> <prope

[转]Null value was assigned to a property of primitive type setter of&quot;原因及解决方法

原文地址:http://blog.csdn.net/kevinzhangfei/article/details/6995316 在action请求数据的过程中报出"Null value was assigned to a property of primitive type setter of"错误,搜索之后发现是因为数据库里相应的字段为NULL. 例如: Java代码 <!--Hibernate映射文件中的字段--> <property name="pri

Null value was assigned to a property of primitive type setter of。

前段时间,写了个方法,测试的时候报错了.Null value was assigned to a property of primitive type setter of.百度了一下,发现是hibernate的问题.sqlserver数据库中,字段类型为float,类中用float类型,那么,hibernate不允许数据库中的这个字段值为null. 解决方法:类中字段类型改为 Float 类型--float的封装类. 原文地址:https://www.cnblogs.com/wensy/p/88