<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/VDB+Definition">VDB Definition</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~rareddy">Ramesh Reddy</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >Used to override the visibility of imported vdb models, where model is the name of the imported model. <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* _include-pg-metadata_   <br>By default, PG metadata is always added to VDB unless [System Properties] set property _org.teiid.addPGMetadata_ to false. This property enables adding PG metadata per VDB. Please note that if you are using ODBC to access your VDB, the VDB must include PG metadata. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h1. import-vdb Element <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>A VDB or virtual database definition is contained in an XML file. For .vdb archive files created in the design tool, this file is embedded in the archive and most fields can be updated through tooling. The XML schema for this file can be found in the docs/teiid/schema directory.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example VDB XML</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;vdb name="${vdb-name}" version="${vdb-version}"&gt;

    &lt;!-- VDB properties --&gt;
    &lt;property name="${property-name}" value="${property-value}" /&gt;

    &lt;!-- UDF defined in an AS module,  see Developers Guide --&gt; 
    &lt;property name ="lib" value ="{module-name}"&gt;&lt;/property&gt;

    &lt;import-vdb name="..." version="..." import-data-policies="true|false"/&gt;

    &lt;!-- define a model fragment for each data source --&gt;
    &lt;model visible="true" name="${model-name}" type="${model-type}" &gt;

        &lt;property name="..." value="..." /&gt;

        &lt;source name="${source-name}" translator-name="${translator-name}" connection-jndi-name="${deployed-jndi-name}"&gt;

        &lt;metadata type="${repository-type}"&gt;raw text&lt;/metadata&gt;
        
        &lt;!-- additional metadata
        &lt;metadata type="${repository-type}"&gt;raw text&lt;/metadata&gt;
        --&gt;

    &lt;/model&gt;

   &lt;!-- define a model with multiple sources - see Multi-Source Models --&gt;
   &lt;model name="${model-name}" path="/Test/Customers.xmi"&gt;
        &lt;property name="multisource" value="true"/&gt;
        . . .
        &lt;source name="${source-name}"
            translator-name="${translator-name}" connection-jndi-name="${deployed-jndi-name}"/&gt;
        &lt;source . . . /&gt;
        &lt;source . . . /&gt;
    &lt;/model&gt;

    &lt;!-- see Reference Guide - Data Roles --&gt;
    &lt;data-role name="${role-name}"&gt;
        &lt;description&gt;${role-description}&lt;/description&gt;
        ….
    &lt;/data-role&gt;

    &lt;!-- create translator instances that override default properties --&gt;
    &lt;translator name="${translator-name}" type="${translator-type}" /&gt;

        &lt;property name="..." value="..." /&gt;

    &lt;/translator&gt;
&lt;/vdb&gt;
</pre>
</div></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Property Substitution</b><br />If a -vdb.xml file has defined property values like ${my.property.name.value}, these can be replaced by actual values that are defined through JAVA system properties. To define system properties on a JBoss AS server, please consult JBoss AS documentation.</td></tr></table></div>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>You may choose to locally name vdb artifacts as you wish, but the runtime names of deployed VDB artifacts must either be *.vdb for a zip file or *-vdb.xml for an xml file.  Failure to name the deployment properly will result in a deployment failure as the Teiid subsystem will not know how to properly handle the artifact.</td></tr></table></div>

<h1><a name="VDBDefinition-VDBElement"></a>VDB Element</h1>

<p><b>Attributes</b></p>

<ul>
        <li><em>name</em><br/>
The name of the VDB.  The VDB name referenced through the driver or datasource during the connection time.</li>
</ul>


<ul>
        <li><em>version</em><br/>
The version of the VDB (should be an positive integer).  This determines the deployed directory location (see Name), and provides an explicit versioning mechanism to the VDB name.</li>
</ul>


<p><b>Property Elements</b></p>

<ul>
        <li><em>cache-metadata</em><br/>
Can be "true" or "false".  defaults to "false" for -vdb.xml deployments otherwise "true".  If "false", Teiid will obtain metadata once for every launch of the vdb.  "true" will save a file containing the metadata into the PROFILE/data/teiid directory</li>
</ul>


<ul>
        <li><em>query-timeout</em><br/>
Sets the default query timeout in milliseconds for queries executed against this VDB.  0 indicates that the server default query timeout should be used.  Defaults to 0.  Will have no effect if the server default query timeout is set to a lesser value.  Note that clients can still set their own timeouts that will be managed on the client side.</li>
</ul>


<ul>
        <li><em>lib</em><br/>
Set to a list of modules for the vdb classpath for user defined function loading.  See also <a href="/author/display/TEIID/Support+for+User-Defined+Functions+%28Non-Pushdown%29" title="Support for User-Defined Functions (Non-Pushdown)">Support for User&#45;Defined Functions &#40;Non&#45;Pushdown&#41;</a>.</li>
</ul>


<ul>
        <li><em>security-domain</em><br/>
Set to the security domain to use if a specific security domain is applicable to the VDB.  Otherwise the security domain list from the transport will be used.
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
   &lt;property name="security-domain" value="custom-security" /&gt;
</pre>
</div></div>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>An admin needs to configure a matching "custom-security" login module in standalone-teiid.xml configuration file before the VDB is deployed.</td></tr></table></div></li>
</ul>


<ul>
        <li><em>connection.XXX</em><br/>
For use by the ODBC transport and OData to set default connection/execution properties.  See <a href="/author/display/TEIID/Driver+Connection" title="Driver Connection">Driver Connection</a> for all properties.  Note these are set on the connection after it has been established.
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
   &lt;property name="connection.partialResultsMode" value="true" /&gt;
</pre>
</div></div></li>
</ul>


<ul>
        <li><em>authentication-type</em><br/>
Authentication type of configured security domain. Allowed values currently are (GSS, USERPASSWORD). The default is set on the transport (typically USERPASSWORD).</li>
</ul>


<ul>
        <li><em>password-pattern</em><br/>
Regular expression matched against the connecting user's name that determines if USERPASSWORD authentication is used. <em>password-pattern</em> Takes precedence of over <em>authentication-type</em>. The default is <em>authentication-type</em>.</li>
</ul>


<ul>
        <li><em>gss-pattern</em><br/>
Regular expression matched against the connecting user's name that determines if GSS authentication is used. <em>gss-pattern</em> Takes precedence of over <em>password-pattern</em>. The default is <em>password-pattern</em>.</li>
</ul>


<ul>
        <li><em>model.visible</em><br/>
Used to override the visibility of imported vdb models, where model is the name of the imported model.</li>
</ul>


<ul>
        <li><em>include-pg-metadata</em><br/>
By default, PG metadata is always added to VDB unless <a href="/author/display/TEIID/System+Properties" title="System Properties">System Properties</a> set property <em>org.teiid.addPGMetadata</em> to false. This property enables adding PG metadata per VDB. Please note that if you are using ODBC to access your VDB, the VDB must include PG metadata.</li>
</ul>


<h1><a name="VDBDefinition-importvdbElement"></a>import-vdb Element</h1>

<p><b>Attributes</b></p>

<ul>
        <li><em>name</em><br/>
The name of the VDB to be imported.</li>
</ul>


<ul>
        <li><em>version</em><br/>
The version of the VDB to be imported (should be an positive integer).</li>
</ul>


<ul>
        <li><em>import-data-policies</em><br/>
Optional attribute to indicate whether the data policies should be imported as well.  Defaults to "true".</li>
</ul>


<h1><a name="VDBDefinition-ModelElement"></a>Model Element</h1>

<p><b>Attributes</b></p>

<ul>
        <li><em>name</em><br/>
The name of the model is used as a top level schema name for all of the metadata imported from the connector.  The name should be unique among all Models in the VDB and should not contain the '.' character.</li>
</ul>


<ul>
        <li><em>visible</em><br/>
By default this value is set to "true", when the value is set to "false", this model will not be visible to when JDBC metadata queries. Usually it is used to hide a model from client applications that should not directly issue queries against it. However, this does not prohibit either client application or other view models using this model, if they knew the schema for this model.</li>
</ul>


<p><b>Property Elements</b></p>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>All properties are available as extension metadata on the corresponding <tt>Schema</tt> object that is accessible via the metadata API.</td></tr></table></div>

<ul>
        <li><em>cache-metadata</em><br/>
Can be "true" or "false".  defaults to "false" for -vdb.xml deployments otherwise "true".  If "false", Teiid will obtain metadata once for every launch of the vdb.  "true" will save a file containing the metadata into the PROFILE/data/teiid directory  Can be used to override the vdb level cache-metadata property.</li>
</ul>


<p><b>Source Element</b></p>

<p>A source is a named binding of a translator and connection source to a model.</p>

<ul>
        <li><em>name</em><br/>
The name of the source to use for this model. This can be any name you like, but will typically be the same as the model name.  Having a name different than the model name is only useful in multi-source scenarios.        In multi-source, the source names under a given model must be unique.  If you have the same source bound to multiple models it may have the same name for each.  An exception will be raised if the same source name is used for different sources.</li>
</ul>


<ul>
        <li><em>translator-name</em><br/>
The name or type of the Teiid Translator to use.  Possible values include the built-in types (ws, file, ldap, oracle, sqlserver, db2, derby, etc.) and translators defined in the translators section.</li>
</ul>


<ul>
        <li><em>connection-jndi-name</em><br/>
The JNDI name of this source's connection factory. There should be a corresponding "-ds.xml" file that defines the connection factory in the JBoss AS.  Check out the  deploying VDB dependencies section for info. You also need to deploy these connection factories before you can deploy the VDB.</li>
</ul>


<p><b>Property Elements</b></p>

<ul>
        <li><em>importer.&lt;propertyname&gt;</em><br/>
Property to be used by the connector importer for the model for purposes importing metadata.  See possible property name/values in the Translator specific section. Note that using these properties you can narrow or widen the data elements available for integration.</li>
</ul>


<p><b>Metadata Element</b></p>

<p>The optional metadata element defines the metadata repository type and optional raw metadata to be consumed by the metadata repository.</p>

<ul>
        <li><em>type</em><br/>
The metadata repository type.  Defaults to INDEX for Designer VDBs and NATIVE for non-Designer VDB source models.  For all other deployments/models a value must be specified.  Built-in types include DDL, NATIVE, INDEX, and DDL-FILE.  The usage of the raw text varies with the by type.  NATIVE and INDEX (only for Designer VDBs) metadata repositories do not use the raw text.  The raw text for DDL is expected to be be a series of DDL statements that define the schema - see also <a href="/author/display/TEIID/DDL+Metadata" title="DDL Metadata">DDL Metadata</a>.  DDL-FILE (used only with zip deployments) is similar to DDL, except that the raw text specifies an absolute path relative to the vdb root of the location of a file containing the DDL.  See also <a href="/author/display/TEIID/Custom+Metadata+Repository" title="Custom Metadata Repository">Custom Metadata Repository</a>.  Use more than 1 metadata element to define multiple sources of metadata.</li>
</ul>


<h1><a name="VDBDefinition-TranslatorElement"></a>Translator Element</h1>

<p><b>Attributes</b></p>

<ul>
        <li><em>name</em><br/>
The name of the the Translator.  Referenced by the source element.</li>
</ul>


<ul>
        <li><em>type</em><br/>
The base type of the Translator.  Can be one of the built-in types (ws, file, ldap, oracle, sqlserver, db2, derby, etc.).</li>
</ul>


<p><b>Property Elements</b></p>

<ul>
        <li>Set a value that overrides a translator default property.  See possible property name/values in the Translator specific section.</li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/VDB+Definition">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646285&revisedVersion=30&originalVersion=29">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/VDB+Definition?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>