-2

How to Create Dynamic Queries When Parameters are Listed, If We Have Multiple Comboboxes, For each Combobox to be Selected, an and must be added to the query that does not work in jpql enter image description here

fariba
  • 1
  • 1

2 Answers2

0

The proper JPA query format would be:

SELECT t FROM table_name t WHERE t.val IN :list;

where :list is your list of values.

sovannarith cheav
  • 743
  • 1
  • 6
  • 19
0

You won't be able to do it directly, for that you need to use JPA specification using it you can achieve dynamic parametric query.

Refer this link from Specification: https://spring.io/blog/2011/04/26/advanced-spring-data-jpa-specifications-and-querydsl/

K.D
  • 407
  • 3
  • 10