In a J2EE project, using JPA, how can I force a like query to be case insensitive and accent insensitive?
I know about changing session variables NLS_COMP and NLS_SO
(...) using JPA, how can I force a like query to be case insensitive and accent insensitive?
My answer will be JPQL oriented. For the former part, you could do:
where lower(name) like 'johny%';
For the later part, I'm not aware of a standard JPQL way to do it.
At the end, altering the session variables NLS_COMP
and NLS_SORT
is IMO the best option.