3 Replies Latest reply on Mar 27, 2015 1:27 PM by shawkins

    Is model property importer.includeSynonyms supported?

    renat000

      Hi,

      I'm trying to set includeSynonyms property for Oracle connection like so:

       

      ModelMetaData jdbcModel = new ModelMetaData();
      Properties props = new Properties();
      props.setProperty("importer.includeSynonyms", "true");
      jdbcModel.setProperties(props);
      

       

      OracleMetadataProcessor doesn't have this property.

       

      Is importer.includeSynonyms supported?

       

      I have an embedded setup. Teiid version: 8.10.0.Final

        • 1. Re: Is model property importer.includeSynonyms supported?
          shawkins

          > Is importer.includeSynonyms supported?

           

          No that is not a supported property.  Oracle has a SYNONYM table type.  So the primary mechanism for this would be to set the table types - importer.tableTypes which expects a comma separated list.

          • 2. Re: Is model property importer.includeSynonyms supported?
            renat000

            Adding props.setProperty("importer.tableTypes", "TABLE,VIEW,SYNONYM") didn't help.

            WARNING: TEIID31071 Invalid table; Table testmodel.SYNONYMS.S1 has no columns defined
            Exception in thread "main" org.teiid.deployers.VirtualDatabaseException: TEIID40095 TEIID31071 Invalid table; Table testmodel.SYNONYMS.S1 has no columns defined
                at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:714)
                at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:624)
            
            

             

            Looks like it's null by default which makes java.sql.DatabaseMetaData.getTables(String, String, String, String[]) return tables all types).

             

            I have SYNONYMS schema with S1 as a synonym for a table from other schema. The user has all required permissions to query the synonym. Oracle requires includeSynonyms to be set for java.sql.DatabaseMetaData.getColumns(String, String, String, String) to return columns for synonyms.

             

            Is there any other way I can make this work other than setting the property on oracle datasource (oracle.jdbc.pool.OracleDataSource.setConnectionProperties(Properties))?

             

            Edit: reordered sentences.

            • 3. Re: Is model property importer.includeSynonyms supported?
              shawkins

              > Is there any other way I can make this work other than setting the property on oracle datasource (oracle.jdbc.pool.OracleDataSource.setConnectionProperties(Properties))?

               

              I don't believe so.  The importer doesn't have special handling for synonyms and expects all metadata to be available via the usual DatabaseMetaData calls.  If there a reason why you can't set the connection property?