1 of 1 people found this helpful
The end result is just like you mentioned, you can call
"select stock.* from stock"
ConnectionFactory - Provides the connection to the source and executes the given native query and returns results.
Translator - Defines the metadata for the source in dynamic scenarios, and provides the translation layer where given Teiid SQL query is converted to a source specific query, which gets passed down to a connection factory. You can also choose to define the metadata in the form of DDL using these https://docs.jboss.org/author/display/teiid81final/DDL+Metadata which the example has done.
They are divided by their functionality, so you can not define the metadata on the Connection Factory. I think we should add some example queries uses can run to the embedded example.
Do you mean the embedded kit example, or the dynamic vdb portfolio example?
To further what Ramesh is highlighting about encapsulation you can check the examples under docs/teiid/examples. If you are using a dynamic vdb, see the dyanmicvdb-twitter example for a vdb.xml that specifies a virtual procedure in ddl. You can do the same thing, but for your stock view. If you are using Teiid embedded, then see the embedded-portfolio example TeiidEmbeddedPortfolio class where there is a setSchemaText call on the portfolio schema/model. You can then see that there is a query executed against the portfolio view at the end of the main method.
Thank you, Steven and Ramesh. Yes, I am using Teiid embedded version. I will take a look at TeiidEmbeddedPortolio class. Thanks for your help!