3 Replies Latest reply on Feb 21, 2017 2:32 PM by John Rodrigues

    Prevent queries directly against a Model which is marked 'visible=false'

    John Rodrigues Novice

      Consider the following model definition:


      <model name="GoSalesModel" type="PHYSICAL" visible="false">
        <property name="importer.useFullSchemaName" value="false"/>
        <property name="importer.tableTypes" value="TABLE,VIEW"/>
        <property name="importer.includeSynonyms" value="true"/>
        <property name="importer.schemaPattern" value="GOSALES"/>
        <source name="gosales" translator-name="adfOracle" connection-jndi-name="java:/goSalesDataSource"/>


      Since it's been marked as visible=false, I'd expect that the following should fail:


      select * from GoSalesModel.Product;


      However, that query brings back data.


      My use case is that I'd like to define views on top of GoSalesModel and access the underlying data only from those views:


      <model name="GoSalesViews" type="PHYSICAL" visible="true">
        <source name="gosalesView" translator-name="adfOracle" connection-jndi-name="java:/goSalesDataSource"/>
        <metadata type="DDL">
        <![CDATA[CREATE VIEW Product AS SELECT product.product_number AS PRODUCT_NUMBER, product.base_product_number AS BASE_PRODUCT_NUMBER, product.introduction_date AS INTRODUCTION_DATE, product.discontinued_date AS DISCONTINUED_DATE, product.product_type_code AS PRODUCT_TYPE_CODE, product.product_color_code AS PRODUCT_COLOR_CODE, product.product_size_code AS PRODUCT_SIZE_CODE, product.product_brand_code AS PRODUCT_BRAND_CODE FROM GoSalesModel.product PRODUCT]]>


      i.e. only the following query should bring back data:


      select * from GoSalesViews.Product;


      How can I make this happen?