作者:手浪用户2602933263 | 来源:互联网 | 2018-04-16 02:50
Hibernate
bitsCN.com
Hibernate 查询数据异常 Null value was assigned to a property of primitive type setter of com.chwl.model.Content.score
原因是score字段定义为int类型,而默认值为null。
在java里int类型是不能为null的,所以把默认值设为0就可以了。
修改mysql数据库某个字段默认值的方法:
update content set score = '0';
bitsCN.com