Null value was assigned to a property of primitive type setter of edu.nju.student.model.StudentExam.score
org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of MyDomain.myAttribute
at grails.orm.HibernateCriteriaBuilder.invokeMethod(HibernateCriteriaBuilder.java:1077)
jpa项目中遇到这个错误,谷歌之后说错误在于StudentExam这个model的score类用的是基础数据类型int,应该用对应的Integer
参考:http://stackoverflow.com/questions/3154582/why-do-i-get-a-null-value-was-assigned-to-a-property-of-primitive-type-setter-o
记录备忘