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

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


    Parser<Relation> parser = RelationParser.join(TABLE, NUMBER);
    assertParser(parser, "a", table("a"));
    assertParser(parser, "a cross join table2 as b",
        new CrossJoinRelation(table("a"), new AliasedRelation(table("table2"), "b")));
    assertParser(parser, "a inner join b on 1",
        new JoinRelation(table("a"), JoinType.INNER, table("b"), number(1)));
    assertParser(parser, "a inner join b on 1 left join c on 2 cross join d",
        new CrossJoinRelation(
            new JoinRelation(
                new JoinRelation(table("a"), JoinType.INNER, table("b"), number(1))
                , JoinType.LEFT, table("c"), number(2)),
            table("d")));
    assertParser(parser, "a cross join b inner join c right join d on 1 on 2",
        new JoinRelation(new CrossJoinRelation(table("a"), table("b")),
            JoinType.INNER,
            new JoinRelation(table("c"), JoinType.RIGHT, table("d"), number(1)),
            number(2)));
    assertParser(parser, "a cross join (b FULL join c on 1)",
        new CrossJoinRelation(table("a"),
            new JoinRelation(table("b"), JoinType.FULL, table("c"), number(1))));
  }
View Full Code Here


    Parser<Relation> parser = RelationParser.join(TABLE, NUMBER);
    assertParser(parser, "a", table("a"));
    assertParser(parser, "a cross join table2 as b",
        new CrossJoinRelation(table("a"), new AliasedRelation(table("table2"), "b")));
    assertParser(parser, "a inner join b on 1",
        new JoinRelation(table("a"), JoinType.INNER, table("b"), number(1)));
    assertParser(parser, "a inner join b on 1 left join c on 2 cross join d",
        new CrossJoinRelation(
            new JoinRelation(
                new JoinRelation(table("a"), JoinType.INNER, table("b"), number(1))
                , JoinType.LEFT, table("c"), number(2)),
            table("d")));
    assertParser(parser, "a cross join b inner join c right join d on 1 on 2",
        new JoinRelation(new CrossJoinRelation(table("a"), table("b")),
            JoinType.INNER,
            new JoinRelation(table("c"), JoinType.RIGHT, table("d"), number(1)),
            number(2)));
    assertParser(parser, "a cross join (b FULL join c on 1)",
        new CrossJoinRelation(table("a"),
            new JoinRelation(table("b"), JoinType.FULL, table("c"), number(1))));
  }
View Full Code Here

TOP

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

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.