HTTP Status 500 - Request processing failed; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.hr.manage.po.Employee.serialNumber

org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of comorg.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com

org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com

org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com

org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com

用hibernate查出数据,但是类型不是原来的类型怎么办,新增的实体类还用不用,答案是可以用的.用query.setResultTransformer(Transformers.aliasToBean(AA.class));这种形式可以解决查出来的数据不能使用的问题. 


需要注意的!!!
  (1)这种转换实体类很严格,必须连属性名字要和数据库字段高度一致(注解此时没很大作用用. 
  (2)实体类可以比表字段少一些字段.


相关文章:

  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-12-08
  • 2021-10-26
  • 2021-10-09
相关资源
相似解决方案