【发布时间】:2013-08-22 12:28:23
【问题描述】:
如何在hibernate的内部查询中添加set parameter()方法?
我尝试过这样做,但已经出现错误
这是我的代码
Query query=session.createQuery("select eq.euipmentName,eq.type from Euipment eq where eq.id in(select euipment from Quotation qt where qt. supQuotation=:ids)");
query.setParameter("ids",id);
list = (List<Euipment>)query.list();
【问题讨论】:
-
我的错误是“-----Hibernate: select eq.euipmentName,eq.type from Euipment eq where eq.id in(select euipment from Quotation qt where qt.supQuotation=?) Unknown column 'where 子句'中的'qt.supQuotation' ---- "
-
我的错误是 --Hibernate: select eq.euipmentName,eq.type from Euipment eq where eq. id in(select euipment from Quotation qt where qt.supQuotation=?) 'where 子句'中的未知列 'qt.supQuotation'--
-
在您的数据库控制台上测试您的查询......然后尝试使用 Hibernate