private static void generateNotEqualsCondition(StringBuilder builder, String field, NotEqualsCondition notEqualsCondition) { Key key = notEqualsCondition.getKey(); builder.append(field).append("!="); handleValueAppend(builder, key); }
@Override public SearchCondition mergeCondition(KeyNameMapper nameMapper, String sourceField, String mergeField, SearchCondition condition) { if(condition instanceof NotEqualsCondition) { CompositeKey compositeKey; Key key = getKey(); if(key instanceof CompositeKey) { compositeKey = (CompositeKey) key; } else { compositeKey = new CompositeKey(); compositeKey.addKey(nameMapper, sourceField, key); } return new NotEqualsCondition(compositeKey.addKey(nameMapper, mergeField, ((EqualsCondition) condition).getKey())); } return null; }
private static SearchCondition createCondition(QueryField queryField) { Key searchKey = valueToKey(queryField.getSearchKey()); switch(queryField.getOperator()) { case LARGER_THAN: return new RangeCondition(searchKey, false, null, false); case LARGER_THAN_OR_EQUALS: return new RangeCondition(searchKey, true, null, false); case SMALLER_THAN: return new RangeCondition(null, false, searchKey, false); case SMALLER_THAN_OR_EQUALS: return new RangeCondition(null, false, searchKey, true); case NOT_EQUALS: return new NotEqualsCondition(searchKey); case EQUALS: default: return new EqualsCondition(searchKey); } }
@Override public boolean keyQualifies(Key key) { return getKey().compareTo(key) != 0; }