此内容没有您所选择的语言版本。

12.25. OData Translator


12.25.1. OData Translator

The OData translator exposes the OData V2 and V3 data sources. This translator implements a simple connection for web services in the same way as the Web Services translator.
The OData translator is implemented by the org.teiid.translator.odata.ODataExecutionFactory class and known by the translator type name odata.

Note

Open Data Protocol (OData) is 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.
Using this specification from OASIS group, and with the help from framework OData4J, JBoss Data Virtualization maps OData entities into relational schema. JBoss Data Virtualization 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.
Expand
OData
Mapped to Relational Entity
EntitySet
Table
FunctionImport
Procedure
AssociationSet
Foreign Keys on the Table*
ComplexType
ignored**
* A Many to Many association will result in a link table that can not be selected from, but can be used for join purposes.
** When used in Functions, an implicit table is exposed. When used to define a embedded table, all the columns will be in-lined.
All CRUD operations will be appropriately mapped to the resulting entity based on the SQL submitted to the OData translator.

Note

The resource adapter for this translator is provided by configuring the webservice data source in the JBoss EAP instance. See the Red Hat JBoss Data Virtualization Administration and Configuration Guide for more configuration information.
Using this specification from OASIS group, with the help from the Olingo framework, Teiid maps OData V4 CSDL (Conceptual Schema Definition Language) document from the OData endpoint provided and converts the OData metadata into Teiid's relational schema. The below table shows the mapping selections in OData V4 Translator from CSDL document

12.25.2. OData Translator: Execution Properties

Expand
Table 12.21. Execution Properties
Name
Description
Default
DatabaseTimeZone
The time zone of the database. Used when fetching date, time, or timestamp values
The system default time zone

12.25.3. OData Translator: Importer Properties

Expand
Table 12.22. Importer Properties
Name
Description
Default
schemaNamespace
Namespace of the schema to import
null
entityContainer
Entity Container Name to import
default container
Example importer settings to only import tables and views from NetflixCatalog:
<property name="importer.schemaNamespace" value="System.Data.Objects"/>
<property name="importer.schemaPattern" value="NetflixCatalog"/>
Copy to Clipboard Toggle word wrap

12.25.4. OData Translator: Usage

Usage of an OData source is similar to 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 JBoss Data Virtualization system.
Expand
Table 12.23. Execution Properties
Property Description Default
DatabaseTimeZone
The time zone of the database. Used when fetchings date, time, or timestamp values
The system default time zone
SupportsOdataCount
Supports $count
True
SupportsOdataFilter
Supports $filter
True
SupportsOdataOrderBy
Supports $orderby
true
SupportsOdataSkip
Supports $skip
True
SupportsOdataTop
Supports $top
True
Expand
Table 12.24. Importer Properties
Property Description Default
schemaNamespace
Namespace of the schema to import
Null
entityContainer
Entity Container Name to import
Default container
Here are some importer settings to import tables and views only from NetflixCatalog:
<property name="importer.schemaNamespace" value="System.Data.Objects"/>
<property name="importer.schemaPattern" value="NetflixCatalog"/>
Copy to Clipboard Toggle word wrap

Note

Sometimes it's possible that the odata server you are querying does not fully implement all OData specification features. If your OData implementation does not support a certain feature, then turn off the corresponding capability using "execution Properties", so that Teiid will not pushdown invalid queries to the translator. For example, to turn off $filter you add following to your vdb.xml then use "odata-override" as the translator name on your source model:
<translator name="odata-override" type="odata">
<property name="SupportsOdataFilter" value="false"/>
</translator>
Copy to Clipboard Toggle word wrap

Note

Native or direct query execution is not supported through OData translator. However, user can use Web Services Translator's invokehttp method directly to issue a Rest based call and parse results using SQLXML.

Note

Teiid can not only consume OData based data sources, but it can expose any data source as an Odata based webservice. For more information see OData Support.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat