@Override protected ConstraintBuilder setConstraint(Constraint constraint) { Comparison comparison = (Comparison)constraint; return delegate.setConstraint(new Comparison(new LowerCase(comparison.getOperand1()), comparison.getOperator(), comparison.getOperand2())); } }
/** * @see org.xcmis.search.QueryObjectModelVisitor#visit(org.xcmis.search.model.constraint.Comparison) */ public void visit(Comparison node) throws VisitException { // Push static value to stack Visitors.visit(node.getOperand2(), this); // push operator to stack queryBuilderStack.push(node.getOperator()); // push ignore case flag queryBuilderStack.push(new Boolean(false)); // Push query from DynamicOperand to stack Visitors.visit(node.getOperand1(), this); }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see QueryObjectModelVisitor#visit(Comparison) */ public void visit(Comparison comparison) throws VisitException { strategy.visit(comparison); enqueue(comparison.getOperand1()); enqueue(comparison.getOperand2()); visitNext(); }
DynamicOperand dynamicOperand = node.getOperand1(); if (dynamicOperand instanceof PropertyValue) for (Operator operator : column.getAvailableQueryOperators()) if (node.getOperator().equals(operator)) throw new VisitException("Operator :" + node.getOperator() + " is not availeble query operator for property '" + propertyValueOperand.getPropertyName() + "' of the table '" + propertyValueOperand.getSelectorName() + "'");
/** * Define the right-hand-side of the constraint using the supplied * operator. * * @param operator * the operator; may not be null * @param literal * the literal value * @return the builder used to create the constraint clause, ready to be * used to create other constraints clauses or complete * already-started clauses; never null */ public ConstraintBuilder is(Operator operator, Object literal) { assert operator != null; Literal value = literal instanceof Literal ? (Literal)literal : new Literal(literal); return this.constraintBuilder.setConstraint(new Comparison(left, operator, value)); }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see QueryObjectModelVisitor#visit(Comparison) */ public void visit(Comparison comparison) throws VisitException { comparison.getOperand1().accept(this); append(' ').append(comparison.getOperator().getSymbol()).append(' '); comparison.getOperand2().accept(this); }
/** * Define the right-hand-side of the constraint using the supplied * operator. * * @param operator * the operator; may not be null * @param variableName * the name of the variable * @return the builder used to create the constraint clause, ready to be * used to create other constraints clauses or complete * already-started clauses; never null */ public ConstraintBuilder isVariable(Operator operator, String variableName) { Validate.notNull(operator, "The operator argument may not be null"); return this.constraintBuilder .setConstraint(new Comparison(left, operator, new BindVariableName(variableName))); }
@Override protected ConstraintBuilder setConstraint(Constraint constraint) { Comparison comparison = (Comparison)constraint; return delegate.setConstraint(new Comparison(new UpperCase(comparison.getOperand1()), comparison.getOperator(), comparison.getOperand2())); } }
cons = new Comparison(pv, ((isNot)?Operator.NOT_EQUAL_TO:Operator.EQUAL_TO), l); cons = new And(cons, new Comparison(pv, Operator.NOT_EQUAL_TO, sl)); }else{ cons = new Or(cons, new Comparison(pv, Operator.EQUAL_TO, sl));
public final Constraint likePredicate() throws RecognitionException { Constraint res = null; CommonTree l=null; PropertyValue cr = null; try { // org/xcmis/search/parser/CMISSQLTreeWalker.g:725:3: ( ^( LIKE cr= columnReference l= STRING_LITERAL ) ) // org/xcmis/search/parser/CMISSQLTreeWalker.g:726:3: ^( LIKE cr= columnReference l= STRING_LITERAL ) { match(input,LIKE,FOLLOW_LIKE_in_likePredicate1514); match(input, Token.DOWN, null); pushFollow(FOLLOW_columnReference_in_likePredicate1518); cr=columnReference(); state._fsp--; l=(CommonTree)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_likePredicate1522); match(input, Token.UP, null); String val = l.getText(); val = processLIKELiteral(val); res=new Comparison(cr, Operator.LIKE, new Literal(val)); } } catch (RecognitionException e) { throw e; } finally { } return res; } // $ANTLR end "likePredicate"
res=new Comparison(ve, Operator.EQUAL_TO, l); res=new Comparison(ve, Operator.NOT_EQUAL_TO, l); res=new Comparison(ve, Operator.LESS_THAN, l); res=new Comparison(ve, Operator.LESS_THAN_OR_EQUAL_TO, l); res=new Comparison(ve, Operator.GREATER_THAN, l); res=new Comparison(ve, Operator.GREATER_THAN_OR_EQUAL_TO, l);