Package org.codehaus.jparsec.examples.sql.ast

Examples of org.codehaus.jparsec.examples.sql.ast.UnionRelation


  }
 
  public void testUnion() {
    Parser<Relation> parser = RelationParser.union(TABLE);
    assertParser(parser, "a", table("a"));
    assertParser(parser, "a union b", new UnionRelation(table("a"), false, table("b")));
    assertParser(parser, "a union all b union (c)",
        new UnionRelation(
            new UnionRelation(table("a"), true, table("b")),
            false, table("c")
        )
    );
    assertParser(parser, "a union all (b union (c))",
        new UnionRelation(
            table("a"),
            true,
            new UnionRelation(table("b"), false, table("c"))
        )
    );
  }
View Full Code Here


        new Select(false,
            Arrays.asList(new Projection(number(1), null)),
            Arrays.asList(table("t")),
            null, null, null));
    assertParser(parser, "select 1 from a union select distinct 2 from b",
        new UnionRelation(
            new Select(false,
                Arrays.asList(new Projection(number(1), null)),
                Arrays.asList(table("a")),
                null, null, null),
            false,
View Full Code Here

  @Test
  public void testUnion() {
    Parser<Relation> parser = RelationParser.union(TABLE);
    assertParser(parser, "a", table("a"));
    assertParser(parser, "a union b", new UnionRelation(table("a"), false, table("b")));
    assertParser(parser, "a union all b union (c)",
        new UnionRelation(
            new UnionRelation(table("a"), true, table("b")),
            false, table("c")
        )
    );
    assertParser(parser, "a union all (b union (c))",
        new UnionRelation(
            table("a"),
            true,
            new UnionRelation(table("b"), false, table("c"))
        )
    );
  }
View Full Code Here

        new Select(false,
            Arrays.asList(new Projection(number(1), null)),
            Arrays.asList(table("t")),
            null, null, null));
    assertParser(parser, "select 1 from a union select distinct 2 from b",
        new UnionRelation(
            new Select(false,
                Arrays.asList(new Projection(number(1), null)),
                Arrays.asList(table("a")),
                null, null, null),
            false,
View Full Code Here

TOP

Related Classes of org.codehaus.jparsec.examples.sql.ast.UnionRelation

Copyright © 2018 www.massapicom. 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.