我想要一个包含所有选择的类别的查询,例如:在 ProductDao
enter public List<Product> listselected(List <Product> selectedCategories) {
TypedQuery<Product> findQuery = em
.createQuery(
"SELECT DISTINCT p FROM Product p WHERE p.idcategory='1' AND p.idcategory='2' etc ORDER BY p.idproduct",
Product.class);
return findQuery.getResultList();} here
但参数化