Any AdvancedCriteria equivalent in mobile version ? I would like to build a Criteria of the type "A and B and (C or D)" where
C and D are of the type "fieldName ICONTAINS someValue".
Tried this, but it does not combine operations as I expect:
C and D are of the type "fieldName ICONTAINS someValue".
Tried this, but it does not combine operations as I expect:
Code:
Criterion searchCriteria = new Criterion(); if (searchString.length()>0){ Criterion c[] = new Criterion[SEARCHABLE_FIELDS.length]; for (int i=0; i<c.length;i++){ c[i] = new Criterion(SEARCHABLE_FIELDS[i],OperatorId.ICONTAINS,searchString); } searchCriteria.addCriteria(new Criterion(OperatorId.OR,c)); } Criterion ownerCriterion = new Criterion(ownerItem.getName(),OperatorId.EQUALS,ownerItem.getValue()); Criterion nonfinalCriterion = new Criterion(finalItem.getName(),OperatorId.EQUALS,Boolean.FALSE); Criteria criteria = new Criteria(); criteria.addCriteria(ownerCriterion); criteria.addCriteria(nonfinalCriterion); criteria.addCriteria(searchCriteria);
Comment