本文主要是介绍nested exception is org.hibernate.PropertyNotFoundException: no appropriate constructor in class,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
查询出的VO和 要 从javaBean中的属性的类型不对应,比如 我的 ApiRailWorkAccessOpenVo中id的属性为String
而RailWorkInfo中的id为Long,所以报错。
String hsql_open = "select new com.rail.po.vo.ApiRailWorkAccessOpenVo(t.id,t.workStatus,t.workStart,t.workCode,t.workTeam,t3.workTeamName) "+ " from RailWorkInfo t ,RailWorkEmployee t2,RailTeam t3 "+ " where t.workCode = t2.workCode and t.workTeam = t3.id "+ " and t.dept = '"+dept+"'"+ " and t2.emplpoyeeCode = '"+employeeCode+"'"
List<ApiRailWorkAccessOpenVo> lisAccessOpenVos = this.getHibernateTemplate().find(hsql_open);//有开门权限的员工工单信息
String whseCodeWhere = getWhseCodeWhere(whseCode);//获取下级仓库编码 String sql = "select new java.lang.String(t2.equipCode) from RailAccessInfo t ,RailAccessEquipInfo t2 " +"where t.accessCode = t2.accessCode and t.whseCode in "+whseCodeWhere;
直接用String 也是可以的。哈哈
这篇关于nested exception is org.hibernate.PropertyNotFoundException: no appropriate constructor in class的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!