overmeulen wrote:
Hi,
How do you call the execution of your query?
Given the error, it seems that you are not giving any value to the parameter :processStep ...
The call was originally made like this:
Code:
Query query = createQuery(findAtomicEUPsByProcessStep);
query.setParameter("processStep", step);
return query.getResultList();
So the parameter value was set. I went around this problem by accessing the Generic object in code and using it directly in the WHERE clause and replacing the JOIN clause with a MEMBER OF expression in the WHERE clause. The query is now like this:
Code:
select e from AtomicEUP e
where :generic MEMBER OF e.generics
This produces an SQL query with a subquery in the WHERE statement, which might result in a worse performance than the JOIN statement.
Code:
select
atomiceup0_.ID as ID8_,
[etc...]
from
E_U_P atomiceup0_
where
? in (
select
generic2_.ID
from
GENERICS_MEASUREMENTS generics1_,
GENERIC generic2_
where
atomiceup0_.ID=generics1_.MEASUREMENTS_ID_FK
and generics1_.GENERICS_ID_FK=generic2_.ID
)