JPA where clause all

Posted by Ke on Stack Overflow See other posts from Stack Overflow or by Ke
Published on 2010-03-13T02:34:54Z Indexed on 2010/03/13 2:37 UTC
Read the original article Hit count: 353

Filed under:

Hi,

I'm new to JPA. In SQL, there is "*" which means any all. For example,

SELECT * FROM PRODUCT WHERE CATEGORY=* 

In JPA, the query is:

 Query query = entityManager.createQuery("select o from Product o WHERE o.category = :value");
query.setParameter("category", category);

How can I set category to any category in JPA?

© Stack Overflow or respective owner

Related posts about jpa