To criteria, restrictions is added(and other things but that does not interest right now) for example:
Criteria.add (Restriction.like (“name”, “Pepe”));
by defect when you add one restriction is reconciled through “AND”, that is to say:
Criteria.add (Restriction.like (“name”, “Pepe”));
criteria.add (Restriction.like (“last name”, “Will wash”));
here it looked for all the person who their name is PEPE and his Lavaer last name.
Also the Junction objects exist (Conjunction and Disjunction) to connect with “AND” and “OR”
When we used the Disjunction for “or” is necessary to put followed them
Criterio.add (Restriction.Disjuntcion (Restriction.ilike (something….).add (Restriction.ilike (something….)). add (Restriction.ilike (something….))))
- The question
How obtain that all the restrictions that are added to the criterion connect with “Or”. and not "and" ?
|