Question

Query q = em.createQuery("SELECT u FROM SSUser u WHERE u.emailId=?1")
    .setParameter(1, email);

I thought this would be a valid query, but then I get:

No results for query: SELECT FROM SSUser u WHERE u.emailId=?1

What's the right way to express this query?

Was it helpful?

Solution

This query is correct but positional params are currently broken in GAE/J. This is Issue 128: Positional parameters don't work (JPQL). Workaround: use named parameters.

Query q = em.createQuery("SELECT u FROM SSUser u WHERE u.emailId = :email")
    .setParameter("email", email);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top