Red Hat Training

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

12.24. Object Translator

12.24.1. Object Translator

The Object translator is a bridge for reading Java objects from external sources, such as Map Cache, and delivering them to the engine for processing. To assist in providing that bridge, the OBJECTTABLE function must be used to transform the Java object into rows and columns.
These are the types of object translators:
  • map-cache - supports a local cache that is of type Map and using Key searching. This translator is implemented by the org.teiid.translator.object.ObjectExecutionFactory class.

Note

See the Red Hat JBoss Data Grid resource adapter for this translator. It can be configured to look up the cache container through JNDI or created sources (such as ConfigurationFileName or RemoteServerList).

12.24.2. Object Translator: Execution Properties

The following execution properties are relevant to translating from JBoss Data Grid.

Table 12.20. Execution Properties

Name
Description
Required
Default
SupportsLuceneSearching
Setting to true assumes your objects are annotated and Hibernate/Lucene will be used to search the cache
N
false

12.24.3. Object Translator: Supported Capabilities

The following are the connector capabilities when Key Searching is used:
  • SELECT command
  • CompareCriteria - only EQ
  • InCriteria
The following are the connector capabilities when Hibernate/Lucene Searching is enabled:
  • SELECT command
  • CompareCriteria - EQ, NE, LT, GT, etc.
  • InCriteria
  • OrCriteria
  • And/Or Criteria
  • Like Criteria
  • INSERT, UPDATE, DELETE

12.24.4. Object Translator: Usage

Retrieve objects from a cache and transform into rows and columns.
  • The primary object returned by the cache should have a name in source of 'this'. All other columns will have their name in source (which defaults to the column name) interpreted as the path to the column value from the primary object.
  • All columns that are not the primary key nor covered by a lucene index should be marked as SEARCHABLE 'Unsearchable'.