急 :问一个hibernate映射的问题?java.lang.Integer
数据库表中的字段code是NUMBER ,在映射中我映射的是java.lang.Integer,在类中是 private int code;数据库中code是可以为空的,在查询数据的时候会报:
org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.test.dao.model.mytest.code .....
如果code有一个默认值的话,就一切正常,请问该如何解决这个问题?