views:

14

answers:

1
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?

+1  A: 

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);
Pascal Thivent