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.
评论(0)