Null value was assigned to a property of primitive type setter of com.entity……

错误提示:
Null value was assigned to a property of primitive type setter of com.entity.hs.HSNotice……

解决办法:
Hibernate中配置的对象,所有的属性类型必须是对象类型。
如:
@Column(name="id",length=32)
private int id;//id
得改成:
@Column(name="id",length=32)
private Integer id;//id


一般出现的问题解决把
int修改为其包装类型Integer;
float修改为其包装类型Float;
……

猜你喜欢

转载自fatedgar.iteye.com/blog/2246187