-
1. Re: Gathering Metadata
rareddy Sep 20, 2013 8:40 AM (in response to pinkstondevin)Look at the "getSchema" method on Admin API, you can get DDL form of your metadata of a model.
-
2. Re: Gathering Metadata
pinkstondevin Sep 23, 2013 1:34 PM (in response to rareddy)Ramesh,
Is there a better way to simply grab the table name from the metadata than walking the SQL String manually? For instance if I return a string of DDL from the "getSchema" method, right now I am using this code:
Schema s = helpParse (this.ddl, this.modelName).getSchema();
Map<String, Table> tableMap = s.getTables();
System.out.println(s.getTables());
For my VDB setup, this returns:
{test_bulk=Table name=test_bulk, nameInSource=null, uuid=tid:555892ee3291-b9a0d09f-00000001}
Is there a way to just grab the table name and only return "test_bulk"? Right now I am just walking through the String to return just the pure table name, but was curious is Teiid had it built-in and I am missing it.
Thanks
-
3. Re: Gathering Metadata
rareddy Sep 23, 2013 1:41 PM (in response to pinkstondevin)1 of 1 people found this helpfulDevin,
If you are just looking for table names along with column information and procedures along with parameter info, you can use JDBC metadata object. Look at "DatabaseMetadata" class, that you can retrieve on JDBC connection, by using "getMetadata" method.
If you need full schema (including the view, and its transformations etc) above is only way.
Ramesh..
-
4. Re: Gathering Metadata
pinkstondevin Sep 23, 2013 2:21 PM (in response to rareddy)Thanks Ramesh!