小弟新手,刚开始学习开发,最近出现一个问题,求各位大神指教,小弟万分感谢!
在做的是一个体系分级,已经实现了针对一级表的增、删、改、查,这里是正常的。
但是在做二级表时报错。二级表与一级表的区别只是:增加了一级主键ID。
下面图片是代码:
下面是数据表:标红框的地方是上级ID标识。
下面是报错信息:
1. 保存报错:
非法参数异常发生
javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.byebook.bean.study.CyYw1KP2.kpID
非法参数异常发生
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.byebook.bean.study.CyYw1KP2.kpID
对象不是声明类的实例。
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
查询报错:
①
javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.byebook.bean.study.CyYw1KP2.kp1ID
②
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.byebook.bean.study.CyYw1KP2.kp1ID删除报错:
javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.byebook.bean.study.CyYw1KP2.kp1ID
①
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.byebook.bean.study.CyYw1KP2.kp1ID
②
Caused by: java.lang.IllegalArgumentException: argument type mismatch-
更新报错:
①
javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.byebook.bean.study.CyYw1KP2.kp1ID
②
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.byebook.bean.study.CyYw1KP2.kp1ID
③
Caused by: java.lang.IllegalArgumentException: argument type mismatch求各位大神指教,小弟再次万分感谢!!!