8 Replies Latest reply on Jul 29, 2011 8:28 AM by Mark Addleman

    Programmatically creating materialized views

    Mark Addleman Master

      I'm trying to programmatically construct a VDB using org.teiid.metadata.* classes.  It is going well except for defining materialized views.  As near as I can tell, the only thing I need to do is set some data in org.teiid.metadata.Table.  The following methods seem to be relevant:

      1. setMaterialized(boolean)
      2. setMaterializedStageTable(Table)
      3. setMaterializedTable(Table)
      4. setSelectTransformation(String)
      5. setVirtual(boolean)

      Currently, I am only using setMaterialized(true), setSelectTransformation(select_string_for_data).  As it stands now, our materialized views get created and appear to be loaded with data but the views appear very buggy.  Sometimes we get NPEs other times, queries return incorrect results.


      Should I set data using the other methods?  What is the difference between setMateterializedTable and setMaterializedStageTable?