<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/OData+Translator">OData Translator</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~rareddy">Ramesh Reddy</a>
    </h4>
        <br/>
                         <h4>Changes (2)</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" >{code} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Translator Override Properties <br>||Name||Description||Default|| <br>|SupportsOdataCount|Supports $count|true| <br>|SupportsOdataFilter|Supports $filter|true| <br>|SupportsOdataOrderBy|Supports $orderby|true| <br>|SupportsOdataSkip|Supports $skip|true| <br>|SupportsOdataTop|Supports $top|true| <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">If your OData implementation does not support certain functionality turn it off in the translator so that Teiid can pushdown valid queries to translator. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{info:title=Native Queries} <br>Native or direct query execution is not supported through OData translator. However, user can use Web Services Translator&#39;s _invokehttp_ method directly to issue a Rest based call and parse results using SQLXML. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>The OData translator, known by the type name <em>"odata"</em> exposes the OData V2 and V3 data sources and uses Teiid WS resource adapter for making web service calls. This translator is extension of <em>Web Services Translator</em>.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>What is Odata</b><br /><a href="http://www.odata.org" class="external-link" rel="nofollow">Open Data Protocol (OData)</a> Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores.  OData is being used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites.</td></tr></table></div>

<p>Using this specification from OASIS group, and with the help from framework <a href="http://code.google.com/p/odata4j/" class="external-link" rel="nofollow">OData4J</a>, Teiid maps OData entities into relational schema. Teiid supports reading of CSDL (Conceptual Schema Definition Language) from the OData endpoint provided and converts the OData schema into relational schema. The below table shows the mapping selections in OData Translator from CSDL document</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>OData</th>
<th class='confluenceTh'>Mapped to Relational Entity</th>
</tr>
<tr>
<td class='confluenceTd'>EntitySet</td>
<td class='confluenceTd'>Table</td>
</tr>
<tr>
<td class='confluenceTd'>FunctionImport</td>
<td class='confluenceTd'>Procedure</td>
</tr>
<tr>
<td class='confluenceTd'>AssosiationSet</td>
<td class='confluenceTd'>Foreign Keys on the Table*</td>
</tr>
<tr>
<td class='confluenceTd'>ComplexType</td>
<td class='confluenceTd'>ignored**</td>
</tr>
</tbody></table>
</div>


<p>&#42; A Many to Many association will result in a link table that can not be selected from, but can be used for join purposes.<br/>
&#42;* When used in Functions, an implicit table is exposed. When used to define a embedded table, all the columns will be in-lined</p>

<p>All CRUD operations will be appropriately mapped to the resulting entity based on the SQL submitted to the OData translator.</p>

<h2><a name="ODataTranslator-Usage"></a>Usage</h2>
<p>Usage of a OData source is similar a JDBC translator. The metadata import is supported through the translator, once the metadata is imported from source system and exposed in relational terms, then this source can be queried as if the EntitySets and Function Imports were local to the Teiid system.</p>


<p><b>Execution Properties</b></p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Name</th>
<th class='confluenceTh'>Description</th>
<th class='confluenceTh'>Default</th>
</tr>
<tr>
<td class='confluenceTd'>DatabaseTimeZone</td>
<td class='confluenceTd'>The time zone of the database. Used when fetchings date, time, or timestamp values</td>
<td class='confluenceTd'>The system default time zone</td>
</tr>
</tbody></table>
</div>


<p><b>Importer Properties</b></p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Name</th>
<th class='confluenceTh'>Description</th>
<th class='confluenceTh'>Default</th>
</tr>
<tr>
<td class='confluenceTd'>schemaNamespace</td>
<td class='confluenceTd'>Namespace of the schema to import</td>
<td class='confluenceTd'>null</td>
</tr>
<tr>
<td class='confluenceTd'>entityContainer</td>
<td class='confluenceTd'>Entity Container Name to import</td>
<td class='confluenceTd'>default container</td>
</tr>
</tbody></table>
</div>


<p>Example importer settings to only import tables and views from NetflixCatalog.</p>

<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="importer.schemaNamespace" value="System.Data.Objects"/&gt;
&lt;property name="importer.schemaPattern" value="NetflixCatalog"/&gt;
</pre>
</div></div>

<p>Translator Override Properties</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Name</th>
<th class='confluenceTh'>Description</th>
<th class='confluenceTh'>Default</th>
</tr>
<tr>
<td class='confluenceTd'>SupportsOdataCount</td>
<td class='confluenceTd'>Supports $count</td>
<td class='confluenceTd'>true</td>
</tr>
<tr>
<td class='confluenceTd'>SupportsOdataFilter</td>
<td class='confluenceTd'>Supports $filter</td>
<td class='confluenceTd'>true</td>
</tr>
<tr>
<td class='confluenceTd'>SupportsOdataOrderBy</td>
<td class='confluenceTd'>Supports $orderby</td>
<td class='confluenceTd'>true</td>
</tr>
<tr>
<td class='confluenceTd'>SupportsOdataSkip</td>
<td class='confluenceTd'>Supports $skip</td>
<td class='confluenceTd'>true</td>
</tr>
<tr>
<td class='confluenceTd'>SupportsOdataTop</td>
<td class='confluenceTd'>Supports $top</td>
<td class='confluenceTd'>true</td>
</tr>
</tbody></table>
</div>


<p>If your OData implementation does not support certain functionality turn it off in the translator so that Teiid can pushdown valid queries to translator.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Native Queries</b><br />Native or direct query execution is not supported through OData translator. However, user can use Web Services Translator's <em>invokehttp</em> method directly to issue a Rest based call and parse results using SQLXML.</td></tr></table></div>
    </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/OData+Translator">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=59146603&revisedVersion=3&originalVersion=2">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/OData+Translator?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>