/** * 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)); }
/** * 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 LowerCase(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));
@Override protected ConstraintBuilder setConstraint(Constraint constraint) { Comparison comparison = (Comparison)constraint; return delegate.setConstraint(new Comparison(new UpperCase(comparison.getOperand1()), comparison.getOperator(), comparison.getOperand2())); } }
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);