My requirement is to do a search in database based on a string.
That particular string might be stored in uppercase, in database.
So, I will have to do a case-insensitive search through HQL
My current HQL is
String query = "from OrganizationContent where orgUrl=:url";
Map<String,Object> parameterMap = new HashMap<String,Object>();
parameterMap.put("url", organizationUrlInput.toLowerCase());
Only ".toLowerCase" I can do from java end. Now I need hibernate to fetch the data by doing a case-insensitive search.
Appreciate your help on this friends
From the documentation:
Expressions used in the where clause include the following:
[...]
Any function or operator defined by EJB-QL 3.0: substring(), trim(), lower(), upper(), length(), locate(), abs(), sqrt(), bit_length(), mod()
from OrganizationContent where lower(orgUrl) = :url
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With