6 Replies Latest reply on Mar 1, 2012 3:50 PM by rareddy

    Dynamic VDB and custom Runtime types

    skethire

      I am creating a dynamic VDB for my datasource.   I also have a custom MetadataProcessor for my datasource.

       

      In my custom MetadataProcessor, how do I indicate that a column is a custom type? 

       

      Can I do:

           metadataFactory.addColumn(colName, "mycustomtype", table)  - is this going to work, or does teiid expect the runtime type to be 'object'  in this case?

       

      If the above is not possible, should I use Column.setNativeType("mycustomtype")?   If I use this, does Teiid use it or just capture it a metadata for client programs to utilize?

       

      Is there a better way still?

       

      Thanks

      srini

        • 1. Re: Dynamic VDB and custom Runtime types
          rareddy

          As of 7.7 I do not see how you can add cutom data types to the MetadataFactory, as it does not let user add a datatype. Even when you add,  these must map to the Teiid runtime types. The above example does not work. You can add the native type, however Teiid will not make use of it except for metadata capture. However, if you are working with custom translator you can make use of that information.

           

          Ramesh..

          • 2. Re: Dynamic VDB and custom Runtime types
            skethire

            Thanks Ramesh.

             

            I do have a custom translator.  

             

            I can use the Column.setNativetype() to capture the metadata about the actual runtimetype of the object in my custom translator.

             

            I want to understand if this approach is equivalent to what you recommended here https://community.jboss.org/thread/173138?tstart=0  for a Teiid Designer approach to custom types?

             

            If not, is there a programmatic way, through my custom translator,  to achieve the same?

             

            Thanks

            srini

            • 3. Re: Dynamic VDB and custom Runtime types
              rareddy

              Srini,

               

              Right now that option is only available for Designer based VDBs. However, as part of TEIID-1280 we are revamping metadata API. I would be glad to take look at your usecase if you can log  JIRA requesting the feature. Also, please explain, how you are intending to use this.

               

              Thanks.

               

              Ramesh..

              • 4. Re: Dynamic VDB and custom Runtime types
                markaddleman

                When you say metadata API, do you mean the metadata factory or the admin api?  We make extensive use of both APIs and I'd love to provide some input to the new design.

                • 5. Re: Dynamic VDB and custom Runtime types
                  rareddy

                  Metadata Factory. Essentially similar to what we have in 7.7, with few changes. We are trying to replace the MetadataRepository with a mechanism that can be defined per model on VDB in vdb.xml, where metadata interface of the model can be pluggable. Supplying the DDL based metadata (in vdb.xml) is going to be available out of the box.

                   

                  Sure, love to hear any comments. You can comment on above JIRA.

                   

                  Thanks

                   

                  Ramesh..

                  • 6. Re: Dynamic VDB and custom Runtime types
                    rareddy

                    By the way here is some discussion on it https://community.jboss.org/thread/194746, however the MetadataFactory stuff you are interested in is not discussed there. Those are result of accommodating the above feature.

                     

                    Ramesh..