Case Insensitive Restriction.IN

I searched a little Google, but did not find decent solutions ...

What I would like to achieve, the source comes with me :)

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

templates is a collection, I want all my objects having a column of names matching -CASE-INSENSITIVELY for any of the templates.

Is it possible without loops and scrolling for each element of the templates?

+6
source share
1 answer

Unfortunately, this function is not implemented in the criteria API. You must implement your own InExpression. See Answer in Ignorecase for In-Criterion

+2
source

Source: https://habr.com/ru/post/912692/


All Articles