문제

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?

도움이 되었습니까?

해결책

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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top