use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestQueryRewriter method testRewriteCase1954b.
@Test
public void testRewriteCase1954b() throws Exception {
QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
CompareCriteria expected = new CompareCriteria();
// $NON-NLS-1$
ElementSymbol leftElement = new ElementSymbol("pm1.g1.e4");
Constant constant = new Constant(new Double(3.0), DataTypeManager.DefaultDataClasses.DOUBLE);
expected.setLeftExpression(leftElement);
expected.setRightExpression(constant);
// resolve against metadata
QueryResolver.resolveCriteria(expected, metadata);
// $NON-NLS-1$
helpTestRewriteCriteria("convert(pm1.g1.e4, string) = '3.0'", expected, metadata);
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestCompoundCriteria method testClone2.
public void testClone2() {
// $NON-NLS-1$
ElementSymbol e1 = new ElementSymbol("e1");
// $NON-NLS-1$
CompareCriteria ccrit1 = new CompareCriteria(e1, CompareCriteria.EQ, new Constant("abc"));
CompoundCriteria comp = new CompoundCriteria(CompoundCriteria.AND, ccrit1, null);
UnitTestUtil.helpTestEquivalence(0, comp, comp.clone());
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestCreate method sample2.
public static final Create sample2() {
Create create = new Create();
// $NON-NLS-1$
create.setTable(new GroupSymbol("temp_table2"));
List elements = new ArrayList();
// $NON-NLS-1$
elements.add(new ElementSymbol("a"));
// $NON-NLS-1$
elements.add(new ElementSymbol("b"));
create.setElementSymbolsAsColumns(elements);
return create;
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestSelect method sample1.
// ################################## TEST HELPERS ################################
public static final Select sample1() {
List symbols = new ArrayList();
// $NON-NLS-1$
symbols.add(new ElementSymbol("a"));
// $NON-NLS-1$
symbols.add(new ElementSymbol("b"));
Select select = new Select();
MultipleElementSymbol all = new MultipleElementSymbol();
all.setElementSymbols(symbols);
select.addSymbol(all);
return select;
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestSelect method sample2.
public static final Select sample2() {
Select select = new Select();
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("a"));
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("b"));
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("c"));
// $NON-NLS-1$ //$NON-NLS-2$
select.addSymbol(new AliasSymbol("Z", new ElementSymbol("ZZ 9 Plural Z Alpha")));
return select;
}
Aggregations