I have to add Restriction.or to my criteria
I am doing
Criterion displayName = Restrictions.ilike("displayName", search, MatchMode.ANYWHERE);
Criterion lastUpdatedName = Restrictions.ilike("lu.displayName", search, MatchMode.ANYWHERE);
Criterion tagTokenVarText = Restrictions.ilike("tvtext.value", search, MatchMode.ANYWHERE);
Criterion tagTokenMultiText = Restrictions.ilike("tmtText.value", search, MatchMode.ANYWHERE);
Criterion tagTokenSiteVar = Restrictions.ilike("ttSiteVar.displayName", search, MatchMode.ANYWHERE);
Criterion tagMultiTokenSiteVar = Restrictions.ilike("tmtSiteVar.displayName", search, MatchMode.ANYWHERE);
Criterion or1 = Restrictions.or(displayName, lastUpdatedName);
Criterion or2 = Restrictions.or(tagTokenVarText, tagTokenMultiText);
Criterion or3 = Restrictions.or(tagTokenSiteVar, tagMultiTokenSiteVar);
Criterion or4 = Restrictions.or(or1, or2);
criteria.add(Restrictions.or(or4, or3));
but i do not like this way of creating Criterion or1, or2...
All my variables (displayName....tagMultiTokenSiteVar ) should be OR. Can I add it to the list or something?