今天在做ssh查询的时候出现
could not locate named parameter
这个错误,String hql = "from AbForCastActive a where a.appId=:appId and a.activeState=:activeState and a.activeStartTime>date";
Map params = new HashMap();
params.put("appId", appId);
params.put("activeState", activeState);
params.put("activeStartTime", date);
return find(hql, params);
我犯了俩个错误
1:a.activeStartTime>date改为a.activeStartTime>:date
2:params.put("activeStartTime", date);改为params.put("date", date);
本文介绍了在使用SSH框架进行查询时遇到的could not locate named parameter错误,并提供了具体的代码示例来说明如何修正字符串拼接中的参数引用问题。
3万+

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



