4 Replies Latest reply on Feb 28, 2014 4:17 PM by virtualdatabase

    Ability to add criteria at model level..

    virtualdatabase

      Just wondering if anyone has encountered this..

       

      When modeling I always make a 1:1 view model above the physical then I create another view model above that, where semantics come in to play.

      I have come to realize that when doing so there are quite often times that a particular criteria is quite often relevant and recurring.

      For example if I ALWAYS want LOCALEIDENTIFIER = 'en' to be applied [as criteria] to all tables that contain the element/column LOCALEIDENTIFIER  then I should be able to implement such change at the model level.

       

      Anyone else have this thought?

        • 1. Re: Ability to add criteria at model level..
          rareddy

          VDB,

           

          Yes, that is in fact we suggest as good modeling guidelines to our users, we call it "Virtual Base Layer" over all the source models, so that it can be used for any name and data type mismatches or criteria enforcement you are are talking about. Also gives you a plain vanilla abstraction layer, and there is no penalty in terms of performance in adding more view layers.  So, in your case if you want you can add the access pattern to all the tables in that view to have  LOCALEIDENTIFIER in the queries, or define it in the transformation with criteria to filter the rows that conform to LOCALEIDENTIFIER='en'

           

          Ramesh..

          • 2. Re: Ability to add criteria at model level..
            virtualdatabase

            Thanks Ramesh for the feedback but I don't think an access pattern is the way to go as this only requires the value to be entered not insert the value for you.

            However I can see the benefit to adding an access pattern at the model level (i.e. ALL columns named "CUSTOMER_ID" in my model should have an access pattern.

            So again it's more about doing something globally (model context) instead of having touch each view/transformation

             

            Tom

            • 3. Re: Ability to add criteria at model level..
              rareddy

              If you looking at criteria at model, no that is not possible. In Teiid a model is synonymous with a schema. And I do not think we want to change those semantics.

               

              Ramesh..

              • 4. Re: Ability to add criteria at model level..
                virtualdatabase

                For example, you can "edit transformations" at the model level and that's what I would look for something like ADD "Where (OR AND) locationidentifier = 'en' to all transformation views.

                I can also see this done at the create new view model when "transform from existing model" option is chosen..