darrachequesne / spring-data-jpa-datatables

Spring Data JPA extension to work with the great jQuery plugin DataTables (https://datatables.net/)
Apache License 2.0
451 stars 172 forks source link

Default searchCols with multiple value on a column #82

Closed andreidharma closed 6 years ago

andreidharma commented 6 years ago

Hi, is this possible?

From what I know spring-data-jpa-datatables doesn't support regex.

darrachequesne commented 6 years ago

It indeed doesn't support regex. As noted in the README:

Note: the regex flag is currently ignored because JPQL only supports LIKE expressions (with % and _ tokens). Yet you should be able to use the DBMS-specific regex operator with the CriteriaBuilder.function() method.

Nonetheless arrays of values are supported with the + separator: submitting PARAM1+PARAM2+PARAM4 is then converted to SELECT ... FROM ... WHERE attr IN ('PARAM1', 'PARAM2', 'PARAM4').

Or did I misunderstand your question?

andreidharma commented 6 years ago

No, you're right. I tried your solutions but it wasn't working.

As it turns out I need to upgrade the version that I'm using. My bad.

Thank you :)