Reputation: 222
I experiment and found that restrictions not equals default nature is ignore case.Please tell me if i m wrong. I m using hibernate 3.x.
For example:-
add(Restrictions.ne("channelCode","JAVA"));
add(Restrictions.ne("channelCode", "JAVA").ignorecase())
giving me same behaviour for all strings like jAVa, java,JAva etc
Upvotes: 0
Views: 987
Reputation: 222
I have solved the issue, actually mysql search(select) queries are case insenstive by default.
Thanks for your feed back.
Upvotes: 1
Reputation: 21393
When you add ignorecase()
then hibernate tries to convert the value to lower case and do the comparision like this:
lower(this_.channelCode)<>'JAVA'
So this should work without any issues.
Upvotes: 0