Examples of ParamEvaluator


Examples of com.googlecode.gql4j.GqlQuery.ParamEvaluator

  @Test
  public void testValue_1() throws RecognitionException {   
    assertEquals(NullEvaluator.get(), parser("Null").value().r);
    assertEquals(new StringEvaluator("'abc'"), parser("'abc'").value().r);
    assertEquals(new BooleanEvaluator("true"), parser("true").value().r);
    assertEquals(new ParamEvaluator("abc"), parser(":abc").value().r);
    assertEquals(
        new FunctionEvaluator("key",
            ImmutableList.<Evaluator>of(new StringEvaluator("'abc'"))),
        parser("key('abc')").value().r);
   
View Full Code Here

Examples of com.googlecode.gql4j.GqlQuery.ParamEvaluator

 
  @Test
  public void testParseWhere_3() {
    ParseResult actual = GqlQuery.parse("SELECT * from a where a = :1");
    ParseResult expected = new ParseResult().setSelect(new Select(false)).setFrom(new From("a")).setWhere(
        new Where().withCondition(new Condition("a", FilterOperator.EQUAL, new ParamEvaluator("1"))));
    assertEquals(expected, actual);
  }
View Full Code Here

Examples of com.googlecode.gql4j.GqlQuery.ParamEvaluator

 
  @Test
  public void testParseWhere_4() {
    ParseResult actual = GqlQuery.parse("SELECT * from a where a = :abc");
    ParseResult expected = new ParseResult().setSelect(new Select(false)).setFrom(new From("a")).setWhere(
        new Where().withCondition(new Condition("a", FilterOperator.EQUAL, new ParamEvaluator("abc"))));
    assertEquals(expected, actual);
  }
View Full Code Here

Examples of com.googlecode.gql4j.GqlQuery.ParamEvaluator

  @Test
  public void testParseWhere_5() {
    ParseResult actual = GqlQuery.parse("SELECT * from a where a in (:abc, 'b', 'c')");
    ParseResult expected = new ParseResult().setSelect(new Select(false)).setFrom(new From("a")).setWhere(
        new Where().withCondition(new Condition("a", FilterOperator.IN,
            new ListEvaluator(new ParamEvaluator("abc"), new StringEvaluator("'b'"), new StringEvaluator("'c'")))));
    assertEquals(expected, actual);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.