-
1. Re: Adding SOURCE_NAME to metadata for multi-source dynamic VDBs
shawkins Oct 22, 2012 9:54 AM (in response to dstannard)Unfortunately that's not built-in functionality. See https://issues.jboss.org/browse/TEIID-2253 for multi-source issues that could be updated to include this one. The workaround for a dynamic vdb would be to use a custom metadata repository - https://docs.jboss.org/author/display/TEIID/Custom+Metadata+Repository - that add the source name coulmn to each table.
Steve
-
2. Re: Adding SOURCE_NAME to metadata for multi-source dynamic VDBs
dstannard Oct 22, 2012 10:04 AM (in response to shawkins)That looks very interesting.
Are you saying that we would be able to use a Custom Metadata Repository to decorate the existing sourced metadata? Or would we have to build it all ourselves?
Dave
-
3. Re: Adding SOURCE_NAME to metadata for multi-source dynamic VDBs
rareddy Oct 22, 2012 10:13 AM (in response to dstannard)1 of 1 people found this helpfulYou can do either one of them. If choose to decorate existing source medatadata, you would need to submit a comma separated list of the repositories in the
<metadata type=
"NATIVE,MYMODULE"
>
</metadata>
-
4. Re: Adding SOURCE_NAME to metadata for multi-source dynamic VDBs
shawkins Oct 22, 2012 10:15 AM (in response to dstannard)Yes, you would just decorate. The logic would look something like:
public void loadMetadata(MetadataFactory factory, ExecutionFactory<F,C> executionFactory, F connectionFactory) throws TranslatorException {
for (Table t : factory.getSchema().getTables().values()) {
factory.addColumn("SOURCE_NAME", "string", t);
}
}
You would just add the custom repository as the last one to modify the metadata that was already loaded.
-
5. Re: Adding SOURCE_NAME to metadata for multi-source dynamic VDBs
dstannard Oct 22, 2012 10:19 AM (in response to shawkins)Brilliant, thank you. I'll get cracking...