Package org.teiid.query.sql.lang

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


    Select select = new Select();
    ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
    select.addSymbol(a);

    Criteria crit = new NotCriteria(new IsNullCriteria(a));

    Query query = new Query();
    query.setSelect(select);
    query.setFrom(from);
    query.setCriteria(crit);
View Full Code Here


      SearchedCaseExpression sce = new SearchedCaseExpression(Arrays.asList(new ExpressionCriteria(new ElementSymbol("x"))), Arrays.asList(new ElementSymbol("y")));
      helpTestExpression("case when x then y end", "CASE WHEN x THEN y END", sce);
    }
   
    @Test public void testExpressionCriteria1() throws Exception {
      SearchedCaseExpression sce = new SearchedCaseExpression(Arrays.asList(new NotCriteria(new ExpressionCriteria(new ElementSymbol("x")))), Arrays.asList(new ElementSymbol("y")));
      helpTestExpression("case when not x then y end", "CASE WHEN NOT (x) THEN y END", sce);
    }
View Full Code Here

    public TestNotCriteriaImpl(String name) {
        super(name);
    }

    public static NotCriteria helpExample() {
        return new NotCriteria(TestCompareCriteriaImpl.helpExample(CompareCriteria.GE, 100, 200));
    }
View Full Code Here

        CompareCriteria crit2 = new CompareCriteria(g1e2, CompareCriteria.EQ, g2e2);
        crits.add(crit2);

        Criteria atomicCrit1 = null;
        Criteria atomicCrit2 = new CompareCriteria(g2e1, CompareCriteria.EQ, new Constant(new Integer(5)));
        atomicCrit2 = new NotCriteria(atomicCrit2);       
        int expected = RIGHT_SIDE;
        helpTestChooseSiblingAndMarkDependent(group1, atomicCrit1, group2, atomicCrit2, crits, expected);       
        expected = LEFT_SIDE;
        helpTestChooseSiblingAndMarkDependent(group2, atomicCrit2, group1, atomicCrit1, crits, expected);      
    }
View Full Code Here

        Criteria crit1 = new CompareCriteria(g2e1, CompareCriteria.GT, new Constant(new Integer(5)));
        Criteria crit2 = new CompareCriteria(g2e1, CompareCriteria.LT, new Constant(new Integer(7)));
        Criteria atomicCrit2 = new CompoundCriteria(CompoundCriteria.AND, crit1, crit2);
        Criteria crit3 = new MatchCriteria(g2e1, new Constant(new String("cd%"))); //$NON-NLS-1$
        atomicCrit2 = new CompoundCriteria(CompoundCriteria.OR, atomicCrit2, crit3);
        atomicCrit2 = new NotCriteria(atomicCrit2);
       
        int expected = RIGHT_SIDE;
        helpTestChooseSiblingAndMarkDependent(group1, atomicCrit1, group2, atomicCrit2, crits, expected);       
        expected = LEFT_SIDE;
        helpTestChooseSiblingAndMarkDependent(group2, atomicCrit2, group1, atomicCrit1, crits, expected);       
View Full Code Here

        Criteria atomicCrit1 = null;

        Criteria crit1 = new CompareCriteria(g2e1, CompareCriteria.GE, new Constant(new Integer(5)));
        Criteria crit2 = new CompareCriteria(g2e1, CompareCriteria.NE, new Constant(new Integer(7)));
        Criteria atomicCrit2 = new CompoundCriteria(CompoundCriteria.OR, crit1, crit2);
        atomicCrit2 = new NotCriteria(atomicCrit2);
        Criteria crit3 = new CompareCriteria(g2e1, CompareCriteria.LE, new Constant(new Integer(25)));
        atomicCrit2 = new CompoundCriteria(CompoundCriteria.AND, atomicCrit2, crit3);
       
        int expected = LEFT_SIDE;
        helpTestChooseSiblingAndMarkDependent(group1, atomicCrit1, group2, atomicCrit2, crits, expected);       
View Full Code Here

      helpTest(jp2, "(m.g2 INNER JOIN m.g3 ON m.g2.e1 = m.g3.e1) CROSS JOIN m.g1"); //$NON-NLS-1$
  }

    public void testJoinPredicate5() {
        ArrayList<Criteria> crits = new ArrayList<Criteria>();
        crits.add(new NotCriteria(new CompareCriteria(new ElementSymbol("m.g2.e1"), CompareCriteria.EQ, new ElementSymbol("m.g3.e1")))); //$NON-NLS-1$ //$NON-NLS-2$
        JoinPredicate jp = new JoinPredicate(
            new UnaryFromClause(new GroupSymbol("m.g2")), //$NON-NLS-1$
            new UnaryFromClause(new GroupSymbol("m.g3")), //$NON-NLS-1$
            JoinType.JOIN_INNER,
            crits );
View Full Code Here

        mc.setNegated(true);
        helpTest(mc, "m.g.e1 NOT LIKE 'abc'"); //$NON-NLS-1$
    }
   
  public void testNotCriteria1() {
    NotCriteria not = new NotCriteria(new IsNullCriteria(new ElementSymbol("m.g.e1"))); //$NON-NLS-1$
    helpTest(not, "NOT (m.g.e1 IS NULL)"); //$NON-NLS-1$
  }
View Full Code Here

    NotCriteria not = new NotCriteria(new IsNullCriteria(new ElementSymbol("m.g.e1"))); //$NON-NLS-1$
    helpTest(not, "NOT (m.g.e1 IS NULL)"); //$NON-NLS-1$
  }
 
  public void testNotCriteria2() {
    NotCriteria not = new NotCriteria();
    helpTest(not, "NOT (<undefined>)"); //$NON-NLS-1$
  }
View Full Code Here

TOP

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

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.