使用hibernate模板进行hql语句查询报错
HTTP Status 500 - IllegalArgumentException occurred calling getter of cn.mani123.domain.Account.id; :
原语句
String hql = "from Order where account = ?" ;
List list = this.getHibernateTemplate().find(hql,id); 改为:
String hql = "from Order where account = " + id;
List list = this.getHibernateTemplate().find(hql);即可!好像是hibernate的一个bug。。。。。
解决Hibernate HQL查询错误

本文解决了使用Hibernate模板执行HQL语句时出现的IllegalArgumentException异常问题。通过调整HQL语句的参数绑定方式,成功避免了异常并实现了预期的数据查询。
1万+

被折叠的 条评论
为什么被折叠?



