I have a method that receives a lot of params and should use this in a query, EJBQL query. With normal query I can use:
public void method(Long code){
Query q = this.em.createQuery("SELECT a FROM ClassA a WHERE a.code = :code); q.setParameter("code", code);
}
This works very well. But change this to EJBQL dont work as I expected:
public void method(Long code){
EntityQuery<Object> eq = new EntityQuery<Object>();
eq.setEjbql("SELECT a FROM ClassA a WHERE a.code = :code");
//Set here the param code
}
My EntityQuery is from: org.jboss.seam.framework
you shouldn't new entityQuery use this