Package org.teiid.query.sql.lang

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


        result.setGroup(group);
        result.addChange(TestElementImpl.helpExample("vm1.g1", "e1"), new Constant(new Integer(1)));
        result.addChange(TestElementImpl.helpExample("vm1.g1", "e2"), new Constant(new Integer(1)));
        result.addChange(TestElementImpl.helpExample("vm1.g1", "e3"), new Constant(new Integer(1)));
        result.addChange(TestElementImpl.helpExample("vm1.g1", "e4"), new Constant(new Integer(1)));
        result.setCriteria(new CompareCriteria(new Constant(new Integer(1)), CompareCriteria.EQ, new Constant(new Integer(1))));
        return result;
    }
View Full Code Here


  /** SELECT * FROM g1 inner join g2 on g1.a1=g2.a2 */
  @Test public void testInnerJoin() {
    UnaryFromClause g1 = new UnaryFromClause(new GroupSymbol("g1")); //$NON-NLS-1$
    UnaryFromClause g2 = new UnaryFromClause(new GroupSymbol("g2"));     //$NON-NLS-1$
    CompareCriteria jcrit = new CompareCriteria(
      new ElementSymbol("g1.a1"), //$NON-NLS-1$
      CompareCriteria.EQ,
      new ElementSymbol("g2.a2")); //$NON-NLS-1$
    ArrayList<Criteria> crits = new ArrayList<Criteria>();
    crits.add(jcrit);   
View Full Code Here

  /** SELECT * FROM g1, g2 inner join g3 on g2.a=g3.a */
  @Test public void testMixedJoin3() {
    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$
    CompareCriteria jcrit = new CompareCriteria(
      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);   
View Full Code Here

 
  /** Select myG.a myA, myH.b from g myG right outer join h myH on myG.x=myH.x */
  @Test public void testRightOuterJoinWithAliases() {
    UnaryFromClause g = new UnaryFromClause(new GroupSymbol("myG", "g")); //$NON-NLS-1$ //$NON-NLS-2$
    UnaryFromClause h = new UnaryFromClause(new GroupSymbol("myH", "h"));     //$NON-NLS-1$ //$NON-NLS-2$
    CompareCriteria jcrit = new CompareCriteria(
      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);   
View Full Code Here

 
  /** Select myG.x myX, myH.y from g myG right join h myH on myG.x=myH.x */
  @Test public void testRightJoinWithAliases() {
    UnaryFromClause g = new UnaryFromClause(new GroupSymbol("myG", "g")); //$NON-NLS-1$ //$NON-NLS-2$
    UnaryFromClause h = new UnaryFromClause(new GroupSymbol("myH", "h"));     //$NON-NLS-1$ //$NON-NLS-2$
    CompareCriteria jcrit = new CompareCriteria(
      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);   
View Full Code Here

 
  /** Select myG.a myA, myH.b from g myG left outer join h myH on myG.x=myH.x */
  @Test public void testLeftOuterJoinWithAliases() {
    UnaryFromClause g = new UnaryFromClause(new GroupSymbol("myG", "g")); //$NON-NLS-1$ //$NON-NLS-2$
    UnaryFromClause h = new UnaryFromClause(new GroupSymbol("myH", "h"));     //$NON-NLS-1$ //$NON-NLS-2$
    CompareCriteria jcrit = new CompareCriteria(
      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);   
View Full Code Here

  /** Select myG.a myA, myH.b from g myG left join h myH on myG.x=myH.x */
  @Test public void testLeftJoinWithAliases() {
    UnaryFromClause g = new UnaryFromClause(new GroupSymbol("myG", "g")); //$NON-NLS-1$ //$NON-NLS-2$
    UnaryFromClause h = new UnaryFromClause(new GroupSymbol("myH", "h"));     //$NON-NLS-1$ //$NON-NLS-2$
    CompareCriteria jcrit = new CompareCriteria(
      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);   
View Full Code Here

 
  /** Select myG.a myA, myH.b from g myG full outer join h myH on myG.x=myH.x */
  @Test public void testFullOuterJoinWithAliases() {
    UnaryFromClause g = new UnaryFromClause(new GroupSymbol("myG", "g")); //$NON-NLS-1$ //$NON-NLS-2$
    UnaryFromClause h = new UnaryFromClause(new GroupSymbol("myH", "h"));     //$NON-NLS-1$ //$NON-NLS-2$
    CompareCriteria jcrit = new CompareCriteria(
      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);   
View Full Code Here

 
  /** Select g.a, h.b from g full join h on g.x=h.x */
  @Test public void testFullJoin() {
    UnaryFromClause g = new UnaryFromClause(new GroupSymbol("g")); //$NON-NLS-1$
    UnaryFromClause h = new UnaryFromClause(new GroupSymbol("h"));     //$NON-NLS-1$
    CompareCriteria jcrit = new CompareCriteria(
      new ElementSymbol("g.x"), //$NON-NLS-1$
      CompareCriteria.EQ,
      new ElementSymbol("h.x")); //$NON-NLS-1$
    ArrayList<Criteria> crits = new ArrayList<Criteria>();
    crits.add(jcrit);   
View Full Code Here

   
    GroupBy groupBy = new GroupBy();
    groupBy.addSymbol(new ElementSymbol("b", false));     //$NON-NLS-1$
    groupBy.addSymbol(new ElementSymbol("c", false)); //$NON-NLS-1$
   
    CompareCriteria having = new CompareCriteria(new ElementSymbol("b", false), CompareCriteria.EQ, new Constant(new Integer(5))); //$NON-NLS-1$
   
    Query query = new Query();
    query.setSelect(select);
    query.setFrom(from);
    query.setGroupBy(groupBy);
View Full Code Here

TOP

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

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.