Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

14.5. Reusing Virtual Databases

You can treat your deployed VDB as just another database where the database category is your VDB name and each visible model in your VDB is treated as a schema. This is accomplished via a import-vdb XML element in the vdb.xml definition. By allowing VDB's to referenced other VDBs, users can create reusable database components and reduce the amount of modeling required to create complex transformations.
This sample vdb.xml file highlights the import-vdb element and the corresponding import-vdb-reference within the view model's model element:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<vdb version="1" name="PartssupplierViewsVDB"> 
  <property value="false" name="preview"/> 
  <import-vdb import-data-policies="false" version="1" name="PartssupplierSourcesVDB"/> 
  <model visible="true" type="VIRTUAL" name="PartsViewModel" path="/PartssupplierProject/PartsViewModel.xmi"> 
    <property value="1623826484" name="checksum"/> 
    <property value="Relational" name="modelClass"/>
    <property value="false" name="builtIn"/> 
    <property value="655076658.INDEX" name="indexName"/> 
    <property value="PartssupplierSourcesVDB" name="import-vdb-reference"/> 
  </model> 
</vdb> 
Teiid Designer exposes this capability by allowing users to import metadata from deployed VDBs via the JDBC Import option. Through this import, relational VDB source models are created which structurally represent the Catalog (VDB), Schema (Model) and Tables in Virtual DataBase.
When dealing with the these VDB source models there are some limitations or rules, namely:
  • VDB source models are read-only
  • VDB source model name is determined by the deployed model name (schema) from the VDB it was imported from
  • Model names have to be unique within a model project
  • VDB source models have to be imported/created in a project different than the project used to create and deploy the Reuse VDB
  • The JDBC Import Wizard will restrict your options to comply with these rules