Hello,
This looks really simple and I can't believe I haven't found a solution myself. I have a bean named PersonBean, which has a name. Now I want to write a finder method that takes a string and looks for people with that string in their name, case-insensitively. Here is my current EJB QL:
SELECT OBJECT(p)
FROM Person p
WHERE (p.name LIKE ?1)
I have 2 problems with this:
- I want the search to be case-insensitive (the above is case-sensitive) and I can't find something like
lower()
orupper()
in EJB QL. What can I do to have that behavior? UPDATE: I'm using J2EE version 1.4 and glassfish version 2.1, if that matters. - I have to pass an ugly string to the method, i.e
findByString("%john%")
. Is there a way to write the EJB QL so that I can pass something likefindByString("john")
?