JPQL combines IN with LIKE

it is possible to use LIKE in a list in a JPQL query (as in the IN key).

Something like: "Select a From Table a WHERE a.field LIKE IN :list"

So that I can set the parameters as follows: {"12%","13%","16%"} or do I need to dynamically convert many OR sentences cyclically?

thanks necros

+4
source share
1 answer

I think this is not possible as you like, but you can use several OR'ed conditions, such as Select * from table1 where x like "12%1234" OR x like "23%" .

If this doesn't work because the list is too long or whatever, maybe look at the api criteria programmatically or what conditions do you need?

+2
source

All Articles