2 Replies Latest reply on Jul 3, 2012 9:18 AM by Ramesh Reddy

    add MED in models defined in Static/Dynamic VDB

    Nabeel Ahmed Newbie

      HI,

       

      I have been successfully able to create a MED and added a custom property isCreatable for the Column object for static VDB.

      Then i added the MED in my source model.

      Now i can see this Extension property in column properties in teiid desinger.

       

      I have a source model and a view model, i am not exposing my source model in vdb but View model.

       

      So, the question is that do i need to add MED on both models?

      How can i read this extension property for each column using JDBC API?

      How to add MED in dynamic vdb?

      How to intialize the extension property using Column object in translator, so that i can read this in my applicaiton using JDBC metadata API?

       

       

      Any help?

       

      regards,

       

      Nabeel Ahmed

        • 1. Re: add MED in models defined in Static/Dynamic VDB
          Nabeel Ahmed Newbie

          Currently i am executing this query to get the property i.e supportUpdates

           

          SELECT

           

           

           

          * FROM SYS.Columns WHERE SchemaName =

          'NORTHWIND'

           

          My assumption is that the custom property will be available in this way.

           

          regards,

           

          Nabeel Ahmed

          • 2. Re: add MED in models defined in Static/Dynamic VDB
            Ramesh Reddy Master

            Nabeel,

             

            MED is framework to add extension properties about your model in Teiid Designer. They are provided with the VDB file to the Teiid engine.

            So, the question is that do i need to add MED on both models?

             

            It only makes sense to add to the source models, as user you only have access to them at translator. A translator is designed for source models not view models. If it were Teiid engine purposes, it can be applied to a particular type model that is being created, such that engine knows about it.

             

             

            How can i read this extension property for each column using JDBC API?

            There is no way to read these custom properties using JDBC API. In the Translator,  when you get a command during execution, you interrogate "RuntimeMetadata" interface about the command's entities and their extended properties. RuntimeMetadata interface is given to you during the execute call.

             

             

            How to add MED in dynamic vdb?

            In the custom translator's getMetadata call. In this call you can define the schema of your source. While defining the source schema, every metadata object like, Table, Column, Procedure, Function etc can be added with any number of properties, those properties in turn represent your custom extensions.

             

             

            How to intialize the extension property using Column object in translator, so that i can read this in my applicaiton using JDBC metadata API?

            column.setProperty(key, value);

            If you want read this information from your end user application, you can read through System  schema. See https://docs.jboss.org/author/display/TEIID/System+Tables. Especially SYS.Properties. You can issue

            {code}

            select * from SYS.Properties

            {code}

            from your app.

             

            Hope this helps.

             

            Ramesh..