I'm looking for Hibernate annotation or .hbm.xml that allows me to specify a table column as case-insensitive string working in unicode/utf-8/locale-independent manner that works on multiple database engines.
Is there any such thing?
So that I can do query using Restrictions.eq("column_name", "search_string")
efficiently.
No, there's no mapping or annotation like that. Your options are:
Restrictions.ilike()
for case-insensitive comparison. It actually uses lower()
internally.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.