I want to use Predicate notLike(Expression x, String pattern) to replace the following query:
select * from mytable
where mytable.myParameter not in ('ABC%','XYZ');
But when I execute my query using the following predicate:
Predicate notLike = builder.notLike(fromMyTable.get(MyTable_.myParameter), "ABC%|BCD");
is not working.
But if I create 2 predicates for the both strings: "ABC%" and "XYZ" is working.
Is my pattern written wrong or where is the problem? I tried to change the pattern in many ways but is still not working.
Thank you!