Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Case insensitive Restriction.IN

I've googled a bit but found no decent solutions...

What i would like to achieve, source comes firts :)

 List<MyStuff> result =
 session.createCriteria(MyStuff.class)
 .add(Restrictions.in("name", templates)).list();

templates is a Collection, thing is, I would like to get all myStuffs, that have name column matching-CASE-INSENSITIVELY to any of templates.

Possible without looping and iliking for every element of templates?

like image 824
wilu Avatar asked Apr 08 '12 16:04

wilu


1 Answers

Unfortunately this feature is not implemented in the Criteria API. You must implement your own InExpression. See the answer in Ignorecase for In-Criterion

like image 73
Cengiz Avatar answered Sep 28 '22 07:09

Cengiz