Examples of toSQL()


Examples of org.nutz.dao.Condition.toSql()

    List<String> list = new ArrayList<String>();
    list.add("'A'");
    list.add("B");
    Condition c = Cnd.where("nm", "iN", list);
    String exp = "WHERE nm IN ('''A''','B')";
    assertEquals(exp, c.toSql(null).trim());
  }

  @Test
  public void test_is_null() {
    Condition c = Cnd.where("nm", " is ", null);
View Full Code Here

Examples of org.nutz.dao.Condition.toSql()

  @Test
  public void test_is_null() {
    Condition c = Cnd.where("nm", " is ", null);
    String exp = "WHERE nm IS NULL";
    assertEquals(exp, c.toSql(null).trim());
  }

  @Test
  public void test_is_not_null() {
    Condition c = Cnd.where("nm", " is nOT ", null);
View Full Code Here

Examples of org.nutz.dao.Condition.toSql()

  @Test
  public void test_is_not_null() {
    Condition c = Cnd.where("nm", " is nOT ", null);
    String exp = "WHERE nm IS NOT NULL";
    assertEquals(exp, c.toSql(null).trim());
  }

  @Test
  public void test_not_in() {
    Condition c = Cnd.where("nm", " Not iN ", new int[]{1, 2, 3});
View Full Code Here

Examples of org.nutz.dao.Condition.toSql()

  @Test
  public void test_not_in() {
    Condition c = Cnd.where("nm", " Not iN ", new int[]{1, 2, 3});
    String exp = "WHERE nm NOT IN (1,2,3)";
    assertEquals(exp, c.toSql(null).trim());
  }
}
View Full Code Here

Examples of tosa.loader.parser.tree.SelectStatement.toSQL()

  @Test public void bootstrapSelectTest() {
    QueryParser parser = new QueryParser(Token.tokenize("SELECT * FROM foo WHERE foo.bar = 10"), makeSampleDBData());
    SelectStatement select = parser.parseTopLevelSelect();
    assertNotNull(select);
    assertNotNull(select.firstToken().toString());
    String sql = select.toSQL();
    System.out.println(sql);
    assertNotNull(sql);
  }

  private DBData makeSampleDBData() {
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.