2016-02-12 161 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