Search in sources :

Example 21 with NamedTable

use of org.teiid.language.NamedTable in project teiid by teiid.

the class TestCollectorVisitor method test1.

@Test
public void test1() {
    // $NON-NLS-1$
    NamedTable g1 = new NamedTable("g1", null, null);
    // $NON-NLS-1$
    ColumnReference e1 = new ColumnReference(g1, "e1", null, String.class);
    // $NON-NLS-1$ //$NON-NLS-2$
    helpTestElementsUsedByGroups(e1, new String[] { "g1.e1" }, new String[] { "g1" });
}
Also used : NamedTable(org.teiid.language.NamedTable) ColumnReference(org.teiid.language.ColumnReference) Test(org.junit.Test)

Example 22 with NamedTable

use of org.teiid.language.NamedTable in project teiid by teiid.

the class TestCollectorVisitor method example1.

public LanguageObject example1() {
    // $NON-NLS-1$
    NamedTable g = new NamedTable("g1", null, null);
    List symbols = new ArrayList();
    // $NON-NLS-1$
    symbols.add(new ColumnReference(g, "e1", null, String.class));
    // $NON-NLS-1$ //$NON-NLS-2$
    Function function = new Function("length", Arrays.asList(new ColumnReference(g, "e2", null, String.class)), Integer.class);
    symbols.add(function);
    List groups = new ArrayList();
    groups.add(g);
    Select q = new Select(symbols, false, groups, null, null, null, null);
    return q;
}
Also used : NamedTable(org.teiid.language.NamedTable) Function(org.teiid.language.Function) ArrayList(java.util.ArrayList) Select(org.teiid.language.Select) ArrayList(java.util.ArrayList) List(java.util.List) ColumnReference(org.teiid.language.ColumnReference)

Example 23 with NamedTable

use of org.teiid.language.NamedTable in project teiid by teiid.

the class TestCollectorVisitor method test2.

@Test
public void test2() {
    // $NON-NLS-1$
    NamedTable g1 = new NamedTable("g1", null, null);
    // $NON-NLS-1$
    ColumnReference e1 = new ColumnReference(g1, "e1", null, String.class);
    // $NON-NLS-1$
    ColumnReference e2 = new ColumnReference(g1, "e2", null, String.class);
    Comparison cc = new Comparison(e1, e2, Operator.EQ);
    // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    helpTestElementsUsedByGroups(cc, new String[] { "g1.e1", "g1.e2" }, new String[] { "g1" });
}
Also used : NamedTable(org.teiid.language.NamedTable) Comparison(org.teiid.language.Comparison) ColumnReference(org.teiid.language.ColumnReference) Test(org.junit.Test)

Aggregations

NamedTable (org.teiid.language.NamedTable)23 ColumnReference (org.teiid.language.ColumnReference)13 ArrayList (java.util.ArrayList)8 Test (org.junit.Test)6 Select (org.teiid.language.Select)6 Table (org.teiid.metadata.Table)6 Column (org.teiid.metadata.Column)5 List (java.util.List)4 DerivedColumn (org.teiid.language.DerivedColumn)4 Expression (org.teiid.language.Expression)4 Insert (org.teiid.language.Insert)4 ExpressionValueSource (org.teiid.language.ExpressionValueSource)3 TableReference (org.teiid.language.TableReference)3 AbstractMetadataRecord (org.teiid.metadata.AbstractMetadataRecord)3 RuntimeMetadata (org.teiid.metadata.RuntimeMetadata)3 DataNotAvailableException (org.teiid.translator.DataNotAvailableException)3 ExecutionContext (org.teiid.translator.ExecutionContext)3 TranslatorException (org.teiid.translator.TranslatorException)3 SalesForceExecutionFactory (org.teiid.translator.salesforce.SalesForceExecutionFactory)3 SalesforceConnection (org.teiid.translator.salesforce.SalesforceConnection)3