3 Replies Latest reply on Jan 6, 2012 1:41 PM by rareddy

    Multi-source awareness in translator

    wannasurf

      Is there any way how we can find out from inside the translator whether we are called as a part of single-source or multi-source model? We need to know this information in the time when our translator is asked for metadata (ExecutionFactory. getMetadata method call) because the metadata we are going to produce depend on this “single/multi source model flag”.

        • 1. Re: Multi-source awareness in translator
          shawkins

          Tim,

           

          The importProperties are actually the model properties, so you can use org.teiid.metadata.MetadataFactory.getImportProperties().getProperty("supports-multi-source-bindings").  Is this related to TEIID-1880?

           

          Steve

          1 of 1 people found this helpful
          • 2. Re: Multi-source awareness in translator
            wannasurf

            No, this is not directly related to TEIID-1880.  Our JBoss/Teiid application requires additional metadata to supplement what the application can discover about the tables in our dynamic VDB from the system tables, and this metadata includes information about the tables and columns we define during the getMetadata function.  The application metadata, as well as the dynmaic VDB tables and columns, is constructed during the processing of the getMetadata function within our custom translators.  For multi-source, the source_name column that Teiid internally adds to each of our tables must also be described by our application metadata at getMetadata time.  However, if we are configured to run single-source, Teiid obviously will not add this column and therefore our translator getMetadata function also should not create application metadata for this column..

            • 3. Re: Multi-source awareness in translator
              rareddy

              Tim,

               

              It is your application that is defining whether the given model is multi-source or not by defining the above property in the -vdb.xml under "model" fragment that Steve mentioned, so the by using above technique you can figure out the model defined this property or not to decide it is multi-source or not.


              Ramesh..