最近迷上了找bug,别问我为什么不迷上找对象,问就是别太简单了
我岂是会随随便便new对象的人,能new出来的那都不叫npy
上菜:
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of spring.hibernate.entities.Student.id
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
介绍一下菜:
调用spring.hibernate. entity . student .id的getter时发生了IllegalArgumentException
原因是对象不是声明类的实例
说白了,就是你这映射配置和实体类属性不一致,导致在实例实体类时,映射报错。
贴上代码:
Student实体类
Student.hbm.xml配置的映射表
所以问题就出来了
这么下来就没毛病了。
扫描二维码关注公众号,回复:
13142185 查看本文章
