Search in sources :

Example 16 with QueryExpression

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

the class TestAsynch method oneTimeSetup.

@BeforeClass
public static void oneTimeSetup() throws Exception {
    server = new FakeServer(true);
    ModelMetaData mmd = new ModelMetaData();
    mmd.setName("v");
    mmd.setModelType(Type.PHYSICAL);
    mmd.setSchemaSourceType("ddl");
    mmd.addSourceMapping("z", "z", null);
    mmd.setSchemaText("create view test (col integer) as select 1; create foreign table someTable (col integer);");
    ef = new HardCodedExecutionFactory() {

        @Override
        public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
            partIds.add(executionContext.getPartIdentifier());
            return super.createResultSetExecution(command, executionContext, metadata, connection);
        }
    };
    server.addTranslator("z", ef);
    server.deployVDB("x", mmd);
}
Also used : ResultSetExecution(org.teiid.translator.ResultSetExecution) ExecutionContext(org.teiid.translator.ExecutionContext) FakeServer(org.teiid.jdbc.FakeServer) HardCodedExecutionFactory(org.teiid.runtime.HardCodedExecutionFactory) TranslatorException(org.teiid.translator.TranslatorException) QueryExpression(org.teiid.language.QueryExpression) RuntimeMetadata(org.teiid.metadata.RuntimeMetadata) ModelMetaData(org.teiid.adminapi.impl.ModelMetaData) BeforeClass(org.junit.BeforeClass)

Aggregations

QueryExpression (org.teiid.language.QueryExpression)16 ResultSetExecution (org.teiid.translator.ResultSetExecution)12 Test (org.junit.Test)11 RuntimeMetadata (org.teiid.metadata.RuntimeMetadata)11 ExecutionContext (org.teiid.translator.ExecutionContext)10 TranslatorException (org.teiid.translator.TranslatorException)9 List (java.util.List)7 ExecutionFactory (org.teiid.translator.ExecutionFactory)7 ArrayList (java.util.ArrayList)6 ModelMetaData (org.teiid.adminapi.impl.ModelMetaData)5 Command (org.teiid.language.Command)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 BeforeClass (org.junit.BeforeClass)3 BufferManager (org.teiid.common.buffer.BufferManager)3 FakeServer (org.teiid.jdbc.FakeServer)3 HardCodedExecutionFactory (org.teiid.runtime.HardCodedExecutionFactory)3 DataNotAvailableException (org.teiid.translator.DataNotAvailableException)3 UpdateExecution (org.teiid.translator.UpdateExecution)3 BigInteger (java.math.BigInteger)2