private void addNotCriteria(String propertyName, String propertyValue, Class propertyType, boolean caseInsensitive, Criteria criteria) { String[] splitPropVal = StringUtils.split(propertyValue, SearchOperator.NOT.op()); try { int strLength = splitPropVal.length; // if Not'ed empty criteria if (strLength == 0) throw new IllegalArgumentException("Improper syntax of NOT operator in " + propertyName); // if more than one NOT operator assume an implicit and (i.e. !a!b = !a&!b) if (strLength > 1) { String expandedNot = SearchOperator.NOT + StringUtils.join(splitPropVal, SearchOperator.AND.op() + SearchOperator.NOT.op()); // we know that since this method was called, treatWildcardsAndOperatorsAsLiteral must be false addCriteria(propertyName, expandedNot, propertyType, caseInsensitive, false, criteria); } else { // only one so add a not like criteria.addNotLike(propertyName, splitPropVal[0]); } } catch (IllegalArgumentException ex) { GlobalVariables.getMessageMap().putError("lookupCriteria[" + propertyName + "]", RiceKeyConstants.ERROR_NOT_SYNTAX, propertyName); } }
criteria.addNotLike("financialDocumentTypeCode", "YE%");
criteria.addNotLike("financialDocumentTypeCode", "YE%");
/** adds a single valued predicate to a Criteria. */ private void addSingleValuePredicate(SingleValuedPredicate p, Criteria parent) { final Object value = getVal(p.getValue()); final String pp = p.getPropertyPath(); if (p instanceof EqualPredicate) { parent.addEqualTo(pp, value); } else if (p instanceof EqualIgnoreCasePredicate) { parent.addEqualTo(genUpperFunc(pp), ((String) value).toUpperCase()); } else if (p instanceof GreaterThanOrEqualPredicate) { parent.addGreaterOrEqualThan(pp, value); } else if (p instanceof GreaterThanPredicate) { parent.addGreaterThan(pp, value); } else if (p instanceof LessThanOrEqualPredicate) { parent.addLessOrEqualThan(pp, value); } else if (p instanceof LessThanPredicate) { parent.addLessThan(pp, value); } else if (p instanceof LikePredicate) { //no need to convert * or ? since ojb handles the conversion/escaping parent.addLike(genUpperFunc(pp), ((String) value).toUpperCase()); } else if (p instanceof NotEqualPredicate) { parent.addNotEqualTo(pp, value); } else if (p instanceof NotEqualIgnoreCasePredicate) { parent.addNotEqualTo(genUpperFunc(pp), ((String) value).toUpperCase()); } else if (p instanceof NotLikePredicate) { parent.addNotLike(pp, value); } else { throw new UnsupportedPredicateException(p); } }
criteria.addNotLike(KFSConstants.FINANCIAL_DOCUMENT_TYPE_CODE, YEAR_END_DOC_PREFIX);
criteria.addNotLike(KFSConstants.FINANCIAL_DOCUMENT_TYPE_CODE, YEAR_END_DOC_PREFIX);
criteria.addNotLike(KFSConstants.FINANCIAL_DOCUMENT_TYPE_CODE, YEAR_END_DOC_PREFIX);