JPA where clause any
- by Ke
Hi,
I'm new to JPA.
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? So if the null category passed, I simple ignore the category parameter, select all products.