Package org.teiid.query.sql.lang

Examples of org.teiid.query.sql.lang.JoinPredicate


  /** SELECT * FROM (g1 cross join g2) cross join (g3 cross join g4) */
  @Test public void testMultiCrossJoin2() {
    UnaryFromClause g1 = new UnaryFromClause(new GroupSymbol("g1")); //$NON-NLS-1$
    UnaryFromClause g2 = new UnaryFromClause(new GroupSymbol("g2"));     //$NON-NLS-1$
    JoinPredicate jp = new JoinPredicate(g1, g2, JoinType.JOIN_CROSS);
    UnaryFromClause g3 = new UnaryFromClause(new GroupSymbol("g3")); //$NON-NLS-1$
    UnaryFromClause g4 = new UnaryFromClause(new GroupSymbol("g4"));     //$NON-NLS-1$
    JoinPredicate jp2 = new JoinPredicate(g3, g4, JoinType.JOIN_CROSS);
    JoinPredicate jp3 = new JoinPredicate(jp, jp2, JoinType.JOIN_CROSS);   
    From from = new From();
    from.addClause(jp3)

    AllSymbol all = new AllSymbol();
    Select select = new Select();
View Full Code Here


  /** SELECT * FROM g1 cross join (g2 cross join g3) */
  @Test public void testMultiCrossJoin3() {
    UnaryFromClause g1 = new UnaryFromClause(new GroupSymbol("g1")); //$NON-NLS-1$
    UnaryFromClause g2 = new UnaryFromClause(new GroupSymbol("g2"));     //$NON-NLS-1$
    UnaryFromClause g3 = new UnaryFromClause(new GroupSymbol("g3")); //$NON-NLS-1$
    JoinPredicate jp = new JoinPredicate(g2, g3, JoinType.JOIN_CROSS);
    JoinPredicate jp2 = new JoinPredicate(g1, jp, JoinType.JOIN_CROSS);
    From from = new From();
    from.addClause(jp2)

    AllSymbol all = new AllSymbol();
    Select select = new Select();
View Full Code Here

  /** SELECT * FROM g1 cross join (g2 cross join g3), g4 */
  @Test public void testMixedJoin() {
    UnaryFromClause g1 = new UnaryFromClause(new GroupSymbol("g1")); //$NON-NLS-1$
    UnaryFromClause g2 = new UnaryFromClause(new GroupSymbol("g2"));     //$NON-NLS-1$
    UnaryFromClause g3 = new UnaryFromClause(new GroupSymbol("g3")); //$NON-NLS-1$
    JoinPredicate jp = new JoinPredicate(g2, g3, JoinType.JOIN_CROSS);
    JoinPredicate jp2 = new JoinPredicate(g1, jp, JoinType.JOIN_CROSS);
    From from = new From();
    from.addClause(jp2);
    from.addClause(new UnaryFromClause(new GroupSymbol("g4")));   //$NON-NLS-1$

    AllSymbol all = new AllSymbol();
View Full Code Here

    UnaryFromClause g2 = new UnaryFromClause(new GroupSymbol("g2"));     //$NON-NLS-1$
    UnaryFromClause g3 = new UnaryFromClause(new GroupSymbol("g3")); //$NON-NLS-1$
    UnaryFromClause g4 = new UnaryFromClause(new GroupSymbol("g4")); //$NON-NLS-1$
    UnaryFromClause g5 = new UnaryFromClause(new GroupSymbol("g5")); //$NON-NLS-1$
    UnaryFromClause g6 = new UnaryFromClause(new GroupSymbol("g6"));     //$NON-NLS-1$
    JoinPredicate jp = new JoinPredicate(g2, g3, JoinType.JOIN_CROSS);
    JoinPredicate jp2 = new JoinPredicate(g1, jp, JoinType.JOIN_CROSS);
    JoinPredicate jp3 = new JoinPredicate(g5, g6, JoinType.JOIN_CROSS);
    From from = new From();
    from.addClause(jp2);
    from.addClause(g4);
    from.addClause(jp3)
View Full Code Here

      new ElementSymbol("g2.a"), //$NON-NLS-1$
      CompareCriteria.EQ,
      new ElementSymbol("g3.a")); //$NON-NLS-1$
    ArrayList<Criteria> crits = new ArrayList<Criteria>();
    crits.add(jcrit);   
    JoinPredicate jp = new JoinPredicate(g2, g3, JoinType.JOIN_INNER, crits);
    From from = new From();
    from.addClause(g1);
    from.addClause(jp);

    AllSymbol all = new AllSymbol();
View Full Code Here

      new ElementSymbol("myG.x"), //$NON-NLS-1$
      CompareCriteria.EQ,
      new ElementSymbol("myH.x")); //$NON-NLS-1$
    ArrayList<Criteria> crits = new ArrayList<Criteria>();
    crits.add(jcrit);   
    JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_RIGHT_OUTER, crits);
    From from = new From();
    from.addClause(jp);

    AliasSymbol as = new AliasSymbol("myA", new ElementSymbol("myG.a")); //$NON-NLS-1$ //$NON-NLS-2$
    Select select = new Select();
View Full Code Here

      new ElementSymbol("myG.x"), //$NON-NLS-1$
      CompareCriteria.EQ,
      new ElementSymbol("myH.x")); //$NON-NLS-1$
    ArrayList<Criteria> crits = new ArrayList<Criteria>();
    crits.add(jcrit);   
    JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_RIGHT_OUTER, crits);
    From from = new From();
    from.addClause(jp);

    AliasSymbol as = new AliasSymbol("myA", new ElementSymbol("myG.a")); //$NON-NLS-1$ //$NON-NLS-2$
    Select select = new Select();
View Full Code Here

      new ElementSymbol("myG.x"), //$NON-NLS-1$
      CompareCriteria.EQ,
      new ElementSymbol("myH.x")); //$NON-NLS-1$
    ArrayList<Criteria> crits = new ArrayList<Criteria>();
    crits.add(jcrit);   
    JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_LEFT_OUTER, crits);
    From from = new From();
    from.addClause(jp);

    AliasSymbol as = new AliasSymbol("myA", new ElementSymbol("myG.a")); //$NON-NLS-1$ //$NON-NLS-2$
    Select select = new Select();
View Full Code Here

      new ElementSymbol("myG.x"), //$NON-NLS-1$
      CompareCriteria.EQ,
      new ElementSymbol("myH.x")); //$NON-NLS-1$
    ArrayList<Criteria> crits = new ArrayList<Criteria>();
    crits.add(jcrit);   
    JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_LEFT_OUTER, crits);
    From from = new From();
    from.addClause(jp);

    AliasSymbol as = new AliasSymbol("myA", new ElementSymbol("myG.a")); //$NON-NLS-1$ //$NON-NLS-2$
    Select select = new Select();
View Full Code Here

      new ElementSymbol("myG.x"), //$NON-NLS-1$
      CompareCriteria.EQ,
      new ElementSymbol("myH.x")); //$NON-NLS-1$
    ArrayList<Criteria> crits = new ArrayList<Criteria>();
    crits.add(jcrit);   
    JoinPredicate jp = new JoinPredicate(g, h, JoinType.JOIN_FULL_OUTER, crits);
    From from = new From();
    from.addClause(jp);

    AliasSymbol as = new AliasSymbol("myA", new ElementSymbol("myG.a")); //$NON-NLS-1$ //$NON-NLS-2$
    Select select = new Select();
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.lang.JoinPredicate

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.