qq_35113297 2017-07-23 10:37 采纳率: 0%
浏览 584

hibernate在执行setParams() 报Source not found

编辑了个hibernatehelper 做了个登录界面 debug了下 执行到query.setParameter后报这个错误(发现map 和hql语句都传进去了) 代码在下面
Source not found for hibernateHelper$$FastClassByCGLIB$$decadcff.invoke(int, Object, Object[]) line: not available

```String hql="from Student where username=:username and userpassword=:password";
public Object queryUniq(String hql,Map map){
Query query=getSession().createQuery(hql);
if(null!=map){
Set set=map.keySet();
Iterator it=set.iterator();
while(it.hasNext()){
String key=(String)it.next();
if(key.contains("List")){
query.setParameterList(key, (Collection) map.get(key));
}else{
query.setParameter(key, map.get(key));
}
}
}
return query.uniqueResult();
}


  • 写回答

1条回答 默认 最新

  • zqbnqsdsmd 2018-07-17 15:05
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services