首页 > 数据库技术 > 详细

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

时间:2016-01-11 10:20:57      阅读:252      评论:0      收藏:0      [点我收藏+]

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即可解决上述异常。  

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

原文:http://www.cnblogs.com/lonelywolfmoutain/p/5120201.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!