org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com
HTTP Status 500 - Request processing failed; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.hr.manage.po.Employee.serialNumber
用hibernate查出数据,但是类型不是原来的类型怎么办,新增的实体类还用不用,答案是可以用的.用query.setResultTransformer(Transformers.aliasToBean(AA.class));这种形式可以解决查出来的数据不能使用的问题.
需要注意的!!!
(1)这种转换实体类很严格,必须连属性名字要和数据库字段高度一致(注解此时没很大作用用.
(2)实体类可以比表字段少一些字段.
(1)这种转换实体类很严格,必须连属性名字要和数据库字段高度一致(注解此时没很大作用用.
(2)实体类可以比表字段少一些字段.