org.springframework.orm.hibernate3.HibernateSystemException: Exception occurred inside setter of com

数据库中某字段为空时
org.springframework.orm.hibernate3.HibernateSystemException: Exception occurred inside setter of com
报错为
org.springframework.orm.hibernate3.HibernateSystemException: Exception occurred inside setter of com在进行查询时,发现数据库内一条数据的某一个字段为空null时,控制台会报这个错。

但是在数据库里面却可以正常查询。

进行查找发现,是对应实体类的相应字段是基本数据类型,在查询结果为空的时候无法set值。

解决办法,将基本数据类型转换成包装类。(如基本数据类型:int,包装类:Integer)

因为包装类是一个类,允许为空null。