2016-02-12 163 views
1
List results= sessionFactory.getCurrentSession().createQuery("from org.gencat.gimah.dao.GimahCobramentTargeta ct where ct.expEcon.id=: idEE and ct.cobrament is null ") 
        .setParameter("idEE", idEE) 
        .list(); 

JBAS014134: EJB Invocation failed on component Expedients for method public abstract java.util.List org.gencat.gimah.model.Expedients.doBuscarDetallExpeconAPartirGestio(long,java.lang.String,boolean) throws org.gencat.gimah.exception.GimahExcepcio,java.rmi.RemoteException: javax.ejb.EJBException: org.hibernate.HibernateException: could not locate named parameter [idEE] 

回答

0

參數ct.expEcon.id=: idEE中存在錯誤。在:之後放置空格是不正確的。您需要通過這種方式

ct.expEcon.id = :idEE

而且,請使用參數,使用更合理的參數的名稱。 idEE是一個不好的選擇,因爲兩個鄰居大寫字母E