CREATE FOREIGN DATA WRAPPER "oracle-override" TYPE oracle OPTIONS (RequiresCriteria 'true');
CREATE SERVER ora FOREIGN DATA WRAPPER "oracle-override" OPTIONS ("resource-name" 'java:/oracle');
CREATE SCHEMA ora SERVER ora;
SET SCHEMA ora;
IMPORT FROM SERVER ora INTO ora;
Translators
Teiid uses the Teiid Connector Architecture (TCA), which provides a robust mechanism for integrating with external systems. The TCA defines a common client interface between Teiid and an external system that includes metadata as to what SQL constructs are available for pushdown and the ability to import metadata from the external system.
A Translator is the heart of the TCA and acts as the bridge logic between Teiid and an external system.
Refer to the Teiid Developers Guide for details on developing custom Translators and JCA resource adapters for use with Teiid.
Tip
|
The TCA is not the same as the JCA, the JavaEE Connector Architecture, although the TCA is designed for use with JCA resource adapters. |
A Translator is typically paired with a particular JCA resource adapter. In instances where pooling, environment dependent configuration management, advanced security handling, etc. are not needed, then a JCA resource adapter is not needed. The configuration of JCA ConnectionFactories for needed resource adapters is not part of this guide, please see the Teiid Administrator Guide and the kit examples for configuring resource adapters for use in WildFly.
Translators can have a number of configurable properties. These are broken down into execution properties, which determine aspects of how data is retrieved, and import settings, which determine what metadata is read for import.
The execution properties for a translator typically have reasonable defaults. For specific translator types, such as the Derby translator, base execution properties are already tuned to match the source. In most cases the user will not need to adjust their values.
Name | Description | Default |
---|---|---|
Immutable |
Set to |
false |
RequiresCriteria |
Set to |
false |
SupportsOrderBy |
Set to |
false |
SupportsOuterJoins |
Set to |
false |
SupportsFullOuterJoins |
If |
false |
SupportsInnerJoins |
Set to |
false |
SupportedJoinCriteria |
If join capabilities are enabled, defines the criteria that can be used as the join criteria. May be one of (ANY, THETA, EQUI, or KEY). |
ANY |
MaxInCriteriaSize |
If the use of |
-1 |
MaxDependentInPredicates |
If the use of |
-1 |
DirectQueryProcedureName |
If |
native |
SupportsDirectQueryProcedure |
Set to |
false |
ThreadBound |
Set to |
false |
CopyLobs |
If |
false |
TransactionSupport |
The highest level of transaction capability. Used by the engine as a hint to determine if a transaction is needed for |
XA |
Note
|
Only a subset of the available metadata can be set through execution properties on the base ExecutionFactory. All methods are available on the BaseDelegatingExecutionFactory. |
There are no base importer settings.
For all translators, you can override Execution Properties in the main vdb file.
.
Or as an XML vdb:
<model name="ora">
<source name="ora" translator-name="oracle-override" connection-jndi-name="java:/oracle"/>
</model>
<translator name="oracle-override" type="oracle">
<property name="RequiresCriteria" value="true"/>
</translator>
The preceding example overrides the oracle translator and sets the RequiresCriteria property to true. The modified translator is only available in the scope of this VDB. As many properties as desired may be overriden together.
See also VDB Definition.
In some situations the teiid_rel:native-query
property and native procedures accept parameterizable strings that can positionally reference IN parameters.
A parameter reference has the form `$integer
, for example, $1
.
Note that one-based indexing is used and that only IN parameters may be referenced.
Dollar-sign integer is therefore reserved, but may be escaped with another $`
, for example, $$1
.
The value will be bound as a prepared value or a literal is a source specific manner.
The native query must return a result set that matches the expectation of the calling procedure.
For example the native-query select c from g where c1 = $1 and c2 = '$$1'
results in a JDBC source query
of select c from g where c1 = ? and c2 = '$1'
, where ?`
will be replaced with the actual value bound to parameter 1.
Several import properties are shared by all translators.
When specifying an importer property, it must be prefixed with importer.
. For example, importer.tableTypes
.
Name | Description | Default |
---|---|---|
autoCorrectColumnNames |
Replace any usage of |
true |
renameDuplicateColumns |
If true, rename duplicate columns caused by either mixed case collisions or |
false |
renameDuplicateTables |
If true, rename duplicate tables caused by mixed case collisions. A suffix |
false |
renameAllDuplicates |
If true, rename all duplicate tables, columns, procedures, and parameters caused by mixed case collisions.
A suffix |
false |
nameFormat |
Set to a Java string format to modify table and procedure names on import.
The only argument will be the original name Teiid name.
For example use |