Hibernate: Null value was assigned to a property of primitive type setter of

hibernate报错:

org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.amg.video....

原因:数据库字段值为NULL,而java数据类型类型int 不能赋值为NULL,只能为0。实体类的属性都应该设为java基本类型对应的包装类(如: Integer),防止查询数据时报错

 

你可能感兴趣的:(Hibernate,实体类)