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

时间:2014-05-09 19:59:18   收藏:0   阅读:318

 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,但有些实际应用中,如学生分数,0表示0分,NULL,则表示暂无分数所以,要不设数据字段不为NULL,要不就是用Integer.

org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type sette,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!