According to this Link
Predicate lcSurnameLikeSearchPattern = criteriaBuilder.like( criteriaBuilder.lower(Person_.surname), searchPattern.toLowerCase());
This seems like Hibernate would generate an SQL that would look something like
LOWER(PERSON.SURNAME) LIKE 'searchPattern'
Where searchPattern would have been lowered in Java using whatever implementation toLowerCase would provide. Whereas the query LOWER would use Oracle implementation. For ASCII characters, I'm guessing things are pretty simple, but would there ever be discrepancies on international UTF characters?
How would I get JPA to lower both operands of LIKE in the query? So the generated query looks like
LOWER(PERSON.SURNAME) LIKE LOWER('searchPattern')