Search in sources :

Example 16 with IsNullCriteria

use of org.teiid.query.sql.lang.IsNullCriteria in project teiid by teiid.

the class TestExpressionEvaluator method testIsNull4.

@Test
public void testIsNull4() throws Exception {
    IsNullCriteria inc = new IsNullCriteria(new Constant(Boolean.TRUE, DataTypeManager.DefaultDataClasses.BOOLEAN));
    inc.setNegated(true);
    assertEquals(Boolean.TRUE, Evaluator.evaluate(inc));
}
Also used : IsNullCriteria(org.teiid.query.sql.lang.IsNullCriteria) Test(org.junit.Test)

Example 17 with IsNullCriteria

use of org.teiid.query.sql.lang.IsNullCriteria in project teiid by teiid.

the class TestExpressionEvaluator method testIsNull3.

@Test
public void testIsNull3() throws Exception {
    IsNullCriteria inc = new IsNullCriteria(new Constant(null, DataTypeManager.DefaultDataClasses.BOOLEAN));
    inc.setNegated(true);
    assertEquals(Boolean.FALSE, Evaluator.evaluate(inc));
}
Also used : IsNullCriteria(org.teiid.query.sql.lang.IsNullCriteria) Test(org.junit.Test)

Example 18 with IsNullCriteria

use of org.teiid.query.sql.lang.IsNullCriteria in project teiid by teiid.

the class TestAccessNode method testOpen_Defect16059_2.

@Test
public void testOpen_Defect16059_2() throws Exception {
    // $NON-NLS-1$
    Query query = (Query) TestResolver.helpResolve("SELECT e1, e2 FROM pm1.g1 WHERE e2 = 5 AND ? IS NOT NULL", RealMetadataFactory.example1Cached());
    IsNullCriteria nullCrit = (IsNullCriteria) ((CompoundCriteria) query.getCriteria()).getCriteria(1);
    nullCrit.setExpression(new Constant(null));
    helpTestOpen(query, null, false);
}
Also used : Query(org.teiid.query.sql.lang.Query) Constant(org.teiid.query.sql.symbol.Constant) IsNullCriteria(org.teiid.query.sql.lang.IsNullCriteria) Test(org.junit.Test)

Example 19 with IsNullCriteria

use of org.teiid.query.sql.lang.IsNullCriteria in project teiid by teiid.

the class TestStaticSymbolMappingVisitor method testVisitIsNullCriteria.

public void testVisitIsNullCriteria() {
    IsNullCriteria inc = new IsNullCriteria(exampleElement(true, 0));
    helpTest(inc, getSymbolMap());
}
Also used : IsNullCriteria(org.teiid.query.sql.lang.IsNullCriteria)

Example 20 with IsNullCriteria

use of org.teiid.query.sql.lang.IsNullCriteria in project teiid by teiid.

the class TestIsNullCriteria method example.

// ################################## TEST HELPERS ################################
public static IsNullCriteria example(String element, boolean negated) {
    IsNullCriteria crit = new IsNullCriteria();
    crit.setNegated(negated);
    crit.setExpression(new ElementSymbol(element));
    return crit;
}
Also used : IsNullCriteria(org.teiid.query.sql.lang.IsNullCriteria)

Aggregations

IsNullCriteria (org.teiid.query.sql.lang.IsNullCriteria)22 CompareCriteria (org.teiid.query.sql.lang.CompareCriteria)6 Criteria (org.teiid.query.sql.lang.Criteria)5 Constant (org.teiid.query.sql.symbol.Constant)5 Test (org.junit.Test)4 PlanNode (org.teiid.query.optimizer.relational.plantree.PlanNode)4 Expression (org.teiid.query.sql.symbol.Expression)4 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)3 Collection (java.util.Collection)2 Query (org.teiid.query.sql.lang.Query)2 SetCriteria (org.teiid.query.sql.lang.SetCriteria)2 Reference (org.teiid.query.sql.symbol.Reference)2 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 QueryPlannerException (org.teiid.api.exception.query.QueryPlannerException)1 ArrayImpl (org.teiid.core.types.ArrayImpl)1 LanguageObject (org.teiid.query.sql.LanguageObject)1 LanguageVisitor (org.teiid.query.sql.LanguageVisitor)1 CompoundCriteria (org.teiid.query.sql.lang.CompoundCriteria)1 DependentSetCriteria (org.teiid.query.sql.lang.DependentSetCriteria)1