1

Is there a way to combine the

Restrictions.in(String, Collection<String>)

with

Restrictions.ilike(String, String)

The goal would be to provide a list of possible matches (like in) but to compare them with the ilike operator instead of a hard compare.

Is this possible?

Geniedesalpages
  • 418
  • 1
  • 3
  • 15

1 Answers1

6

You could build it by your own with the help of org.hibernate.criterion.Disjunction.

Disjunction or = Restrictions.disjunction();
or.add(Restrictions.ilike(String, String));
or.add(Restrictions.ilike(String, String));
or.add(Restrictions.ilike(String, String));
Ralph
  • 118,862
  • 56
  • 287
  • 383