Package org.teiid.translator.odata4
Class ODataExecutionFactory
- java.lang.Object
-
- org.teiid.translator.ExecutionFactory<ConnectionFactory,WSConnection>
-
- org.teiid.translator.odata4.ODataExecutionFactory
-
@Translator(name="odata4", description="A translator for making OData V4 data service calls") public class ODataExecutionFactory extends ExecutionFactory<ConnectionFactory,WSConnection>
TODO: Type comparison isof(T), isof(x, T) Whether targeted instance can be converted to the specified type. media streams are generally not supported yet. (blobs, clobs)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.teiid.translator.ExecutionFactory
ExecutionFactory.Format, ExecutionFactory.NullOrder, ExecutionFactory.SupportedJoinCriteria, ExecutionFactory.TransactionSupport
-
-
Field Summary
Fields Modifier and Type Field Description static TimeZone
DEFAULT_TIME_ZONE
protected Map<String,FunctionModifier>
functionModifiers
-
Fields inherited from class org.teiid.translator.ExecutionFactory
DEFAULT_MAX_FROM_GROUPS, DEFAULT_MAX_IN_CRITERIA_SIZE, DEFAULT_MAX_PROJECTED_COLUMNS
-
-
Constructor Summary
Constructors Constructor Description ODataExecutionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcedureExecution
createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection)
ResultSetExecution
createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection)
UpdateExecution
createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection)
protected String
escapeString(String str, String quote)
List<String>
getDefaultSupportedFunctions()
Map<String,FunctionModifier>
getFunctionModifiers()
Return a map of function name to FunctionModifier.void
getMetadata(MetadataFactory metadataFactory, WSConnection conn)
Implement to provide metadata to the metadata for use by the engine.MetadataProcessor<WSConnection>
getMetadataProcessor()
Get a MetadataProcessor for the translator to read the metadata.protected org.apache.olingo.client.api.edm.xml.XMLMetadata
getSchema(WSConnection conn)
List<String>
getSupportedFunctions()
Get list of all supported function names.void
registerFunctionModifier(String name, FunctionModifier modifier)
Add theFunctionModifier
to the set of known modifiers.void
setSupportsOdataCount(boolean supports)
void
setSupportsOdataFilter(boolean supports)
void
setSupportsOdataOrderBy(boolean supports)
void
setSupportsOdataSkip(boolean supports)
void
setSupportsOdataTop(boolean supports)
void
setSupportsUpdates(boolean supports)
void
start()
Initialize the connector with supplied configurationboolean
supportsAggregatesCount()
Support indicates connector can accept the COUNT aggregate functionboolean
supportsAggregatesCountStar()
Support indicates connector can accept the COUNT(*) aggregate functionboolean
supportsArrayType()
The engine uses array types for dependent joins and for array expression.boolean
supportsCompareCriteriaEquals()
Support indicates connector accepts criteria of form (element = constant)boolean
supportsCompareCriteriaOrdered()
Support indicates connector accepts criteria of form (element <=|>= constant)
The query engine will may pushdown queries containing < or > if NOT is also supported.boolean
supportsGeographyType()
If the geography type is supported by the standard ST_ geospatial functionsboolean
supportsInCriteria()
Support indicates connector accepts criteria of form (element IN set)boolean
supportsIsNullCriteria()
Support indicates connector accepts criteria of form (element IS NULL)boolean
supportsNotCriteria()
Support indicates connector accepts logical criteria NOTboolean
supportsOdataCount()
boolean
supportsOdataFilter()
boolean
supportsOdataOrderBy()
boolean
supportsOdataSkip()
boolean
supportsOdataTop()
boolean
supportsOnlyLiteralComparison()
boolean
supportsOrCriteria()
Support indicates connector accepts logical criteria connected by ORboolean
supportsOrderBy()
Support indicates connector accepts ORDER BY clause, including multiple elements and ascending and descending sorts.boolean
supportsOrderByUnrelated()
Support indicates connector accepts ORDER BY clause with columns not from the selectboolean
supportsQuantifiedCompareCriteriaAll()
Support indicates connector accepts the quantified comparison criteria that use ALLboolean
supportsQuantifiedCompareCriteriaSome()
Support indicates connector accepts the quantified comparison criteria that use SOMEboolean
supportsRowLimit()
Gets whether the connector can limit the number of rows returned by a query.boolean
supportsRowOffset()
Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return result sets that start in the middle of the resulting rows returned by a queryboolean
supportsUpdates()
boolean
useAnsiJoin()
Whether the source prefers to use ANSI style joins.-
Methods inherited from class org.teiid.translator.ExecutionFactory
addPushDownFunction, areLobsUsableAfterClose, closeConnection, createDirectExecution, createExecution, getCacheDirective, getCollationLocale, getConnection, getConnection, getDefaultNullOrder, getDirectQueryProcedureName, getExcludedCommonTableExpressionName, getInstance, getLanguageFactory, getMaxDependentInPredicates, getMaxFromGroups, getMaxInCriteriaSize, getMaxProjectedColumns, getNativeQueryProcedureName, getPushDownFunctions, getRequiredLikeEscape, getSupportedJoinCriteria, getTransactionSupport, getTypeFacility, initCapabilities, isCopyLobs, isForkable, isImmutable, isSourceRequired, isSourceRequiredForCapabilities, isSourceRequiredForMetadata, isThreadBound, requiresCriteria, returnsSingleUpdateCount, setCollationLocale, setCopyLobs, setDirectQueryProcedureName, setExcludedCommonTableExpressionName, setImmutable, setMaxDependentInPredicates, setMaxInCriteriaSize, setNativeQueryProcedureName, setRequiresCriteria, setSourceRequired, setSourceRequiredForMetadata, setSupportedJoinCriteria, setSupportsDirectQueryProcedure, setSupportsFullOuterJoins, setSupportsInnerJoins, setSupportsNativeQueries, setSupportsOrderBy, setSupportsOuterJoins, setSupportsSelectDistinct, setThreadBound, setTransactionSupport, supportsAdvancedOlapOperations, supportsAggregatesAvg, supportsAggregatesCountBig, supportsAggregatesDistinct, supportsAggregatesEnhancedNumeric, supportsAggregatesMax, supportsAggregatesMin, supportsAggregatesSum, supportsAliasedTable, supportsArrayAgg, supportsBatchedUpdates, supportsBulkUpdate, supportsCommonTableExpressions, supportsCompareCriteriaOrderedExclusive, supportsConvert, supportsCorrelatedSubqueries, supportsCorrelatedSubqueryLimit, supportsDependentJoins, supportsDirectQueryProcedure, supportsElementaryOlapOperations, supportsExcept, supportsExistsCriteria, supportsFormatLiteral, supportsFullDependentJoins, supportsFullOuterJoins, supportsFunctionsInGroupBy, supportsGroupBy, supportsGroupByMultipleDistinctAggregates, supportsGroupByRollup, supportsHaving, supportsInCriteriaSubquery, supportsInlineViews, supportsInnerJoins, supportsInsertWithQueryExpression, supportsIntersect, supportsIsDistinctCriteria, supportsLateralJoin, supportsLateralJoinCondition, supportsLikeCriteria, supportsLikeCriteriaEscapeCharacter, supportsLikeRegex, supportsListAgg, supportsMultipleOpenExecutions, supportsNativeQueries, supportsOnlyCorrelatedSubqueries, supportsOnlyFormatLiterals, supportsOnlyLateralJoinProcedure, supportsOnlySingleTableGroupBy, supportsOnlyTimestampAddLiteral, supportsOrderByNullOrdering, supportsOrderByWithExtendedGrouping, supportsOuterJoins, supportsPartialFiltering, supportsProcedureParameterExpression, supportsProcedureTable, supportsRecursiveCommonTableExpressions, supportsScalarSubqueries, supportsScalarSubqueryProjection, supportsSearchedCaseExpressions, supportsSelectDistinct, supportsSelectExpression, supportsSelectExpressionArrayType, supportsSelectWithoutFrom, supportsSelfJoins, supportsSetQueryLimitOffset, supportsSetQueryOrderBy, supportsSimilarTo, supportsStringAgg, supportsSubqueryCommonTableExpressions, supportsSubqueryInOn, supportsUnions, supportsUpsert, supportsWindowDistinctAggregates, supportsWindowFrameClause, supportsWindowFunctionCumeDist, supportsWindowFunctionNthValue, supportsWindowFunctionNtile, supportsWindowFunctionPercentRank, supportsWindowOrderByWithAggregates, useBindingsForDependentJoin
-
-
-
-
Field Detail
-
DEFAULT_TIME_ZONE
public static final TimeZone DEFAULT_TIME_ZONE
-
functionModifiers
protected Map<String,FunctionModifier> functionModifiers
-
-
Method Detail
-
start
public void start() throws TranslatorException
Description copied from class:ExecutionFactory
Initialize the connector with supplied configuration- Overrides:
start
in classExecutionFactory<ConnectionFactory,WSConnection>
- Throws:
TranslatorException
-
getMetadata
public void getMetadata(MetadataFactory metadataFactory, WSConnection conn) throws TranslatorException
Description copied from class:ExecutionFactory
Implement to provide metadata to the metadata for use by the engine. This is the primary method of creating metadata for dynamic VDBs.- Overrides:
getMetadata
in classExecutionFactory<ConnectionFactory,WSConnection>
conn
- may be null if the source is not required- Throws:
TranslatorException
- to indicate a recoverable error, otherwise a RuntimeException- See Also:
ExecutionFactory.isSourceRequiredForMetadata()
-
getMetadataProcessor
public MetadataProcessor<WSConnection> getMetadataProcessor()
Description copied from class:ExecutionFactory
Get a MetadataProcessor for the translator to read the metadata. Typically this will return a new instance.- Overrides:
getMetadataProcessor
in classExecutionFactory<ConnectionFactory,WSConnection>
- Returns:
-
getSchema
protected org.apache.olingo.client.api.edm.xml.XMLMetadata getSchema(WSConnection conn) throws TranslatorException
- Throws:
TranslatorException
-
createResultSetExecution
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException
- Overrides:
createResultSetExecution
in classExecutionFactory<ConnectionFactory,WSConnection>
- Throws:
TranslatorException
-
createProcedureExecution
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException
- Overrides:
createProcedureExecution
in classExecutionFactory<ConnectionFactory,WSConnection>
- Throws:
TranslatorException
-
createUpdateExecution
public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException
- Overrides:
createUpdateExecution
in classExecutionFactory<ConnectionFactory,WSConnection>
- Throws:
TranslatorException
-
getSupportedFunctions
public List<String> getSupportedFunctions()
Description copied from class:ExecutionFactory
Get list of all supported function names. Arithmetic functions have names like "+".- Overrides:
getSupportedFunctions
in classExecutionFactory<ConnectionFactory,WSConnection>
- See Also:
for a listing of system pushdown functions. Note that not all system functions are listed as some functions will use a common name such as CONCAT vs. the || operator, and other functions will be rewritten and not pushed down, such as SPACE. Note: User defined functions should be specified fully qualified.
-
getFunctionModifiers
public Map<String,FunctionModifier> getFunctionModifiers()
Return a map of function name to FunctionModifier.- Returns:
- Map of function name to FunctionModifier.
-
registerFunctionModifier
public void registerFunctionModifier(String name, FunctionModifier modifier)
Add theFunctionModifier
to the set of known modifiers.- Parameters:
name
-modifier
-
-
supportsOdataFilter
@TranslatorProperty(display="Supports $Filter", description="True, $filter is supported", advanced=true) public boolean supportsOdataFilter()
-
setSupportsOdataFilter
public void setSupportsOdataFilter(boolean supports)
-
supportsOdataOrderBy
@TranslatorProperty(display="Supports $OrderBy", description="True, $orderby is supported", advanced=true) public boolean supportsOdataOrderBy()
-
setSupportsOdataOrderBy
public void setSupportsOdataOrderBy(boolean supports)
-
supportsOdataCount
@TranslatorProperty(display="Supports $count", description="True, $count is supported", advanced=true) public boolean supportsOdataCount()
-
setSupportsOdataCount
public void setSupportsOdataCount(boolean supports)
-
supportsOdataSkip
@TranslatorProperty(display="Supports $skip", description="True, $skip is supported", advanced=true) public boolean supportsOdataSkip()
-
setSupportsOdataSkip
public void setSupportsOdataSkip(boolean supports)
-
supportsOdataTop
@TranslatorProperty(display="Supports $top", description="True, $top is supported", advanced=true) public boolean supportsOdataTop()
-
setSupportsOdataTop
public void setSupportsOdataTop(boolean supports)
-
supportsUpdates
@TranslatorProperty(display="Supports Updates", description="True, if(PUT,PATCH,DELETE) operations supported", advanced=true) public boolean supportsUpdates()
-
setSupportsUpdates
public void setSupportsUpdates(boolean supports)
-
supportsCompareCriteriaEquals
public boolean supportsCompareCriteriaEquals()
Description copied from class:ExecutionFactory
Support indicates connector accepts criteria of form (element = constant)- Overrides:
supportsCompareCriteriaEquals
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsCompareCriteriaOrdered
public boolean supportsCompareCriteriaOrdered()
Description copied from class:ExecutionFactory
Support indicates connector accepts criteria of form (element <=|>= constant)
The query engine will may pushdown queries containing < or > if NOT is also supported.- Overrides:
supportsCompareCriteriaOrdered
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsIsNullCriteria
public boolean supportsIsNullCriteria()
Description copied from class:ExecutionFactory
Support indicates connector accepts criteria of form (element IS NULL)- Overrides:
supportsIsNullCriteria
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsOrCriteria
public boolean supportsOrCriteria()
Description copied from class:ExecutionFactory
Support indicates connector accepts logical criteria connected by OR- Overrides:
supportsOrCriteria
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsNotCriteria
public boolean supportsNotCriteria()
Description copied from class:ExecutionFactory
Support indicates connector accepts logical criteria NOT- Overrides:
supportsNotCriteria
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsInCriteria
public boolean supportsInCriteria()
Description copied from class:ExecutionFactory
Support indicates connector accepts criteria of form (element IN set)- Overrides:
supportsInCriteria
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsQuantifiedCompareCriteriaSome
public boolean supportsQuantifiedCompareCriteriaSome()
Description copied from class:ExecutionFactory
Support indicates connector accepts the quantified comparison criteria that use SOME- Overrides:
supportsQuantifiedCompareCriteriaSome
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsQuantifiedCompareCriteriaAll
public boolean supportsQuantifiedCompareCriteriaAll()
Description copied from class:ExecutionFactory
Support indicates connector accepts the quantified comparison criteria that use ALL- Overrides:
supportsQuantifiedCompareCriteriaAll
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsOrderBy
@TranslatorProperty(display="Supports ORDER BY", description="True, if this connector supports ORDER BY", advanced=true) public boolean supportsOrderBy()
Description copied from class:ExecutionFactory
Support indicates connector accepts ORDER BY clause, including multiple elements and ascending and descending sorts.- Overrides:
supportsOrderBy
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsOrderByUnrelated
public boolean supportsOrderByUnrelated()
Description copied from class:ExecutionFactory
Support indicates connector accepts ORDER BY clause with columns not from the select- Overrides:
supportsOrderByUnrelated
in classExecutionFactory<ConnectionFactory,WSConnection>
- Returns:
-
supportsAggregatesCount
public boolean supportsAggregatesCount()
Description copied from class:ExecutionFactory
Support indicates connector can accept the COUNT aggregate function- Overrides:
supportsAggregatesCount
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsAggregatesCountStar
public boolean supportsAggregatesCountStar()
Description copied from class:ExecutionFactory
Support indicates connector can accept the COUNT(*) aggregate function- Overrides:
supportsAggregatesCountStar
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsRowLimit
public boolean supportsRowLimit()
Description copied from class:ExecutionFactory
Gets whether the connector can limit the number of rows returned by a query.- Overrides:
supportsRowLimit
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsRowOffset
public boolean supportsRowOffset()
Description copied from class:ExecutionFactory
Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return result sets that start in the middle of the resulting rows returned by a query- Overrides:
supportsRowOffset
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsOnlyLiteralComparison
public boolean supportsOnlyLiteralComparison()
- Overrides:
supportsOnlyLiteralComparison
in classExecutionFactory<ConnectionFactory,WSConnection>
- Returns:
- true if only Literal comparisons (equality, ordered, like, etc.) are supported for non-join conditions.
-
useAnsiJoin
public boolean useAnsiJoin()
Description copied from class:ExecutionFactory
Whether the source prefers to use ANSI style joins.- Overrides:
useAnsiJoin
in classExecutionFactory<ConnectionFactory,WSConnection>
-
supportsArrayType
public boolean supportsArrayType()
Description copied from class:ExecutionFactory
The engine uses array types for dependent joins and for array expression.- Overrides:
supportsArrayType
in classExecutionFactory<ConnectionFactory,WSConnection>
- Returns:
- true if an array type is supported.
-
supportsGeographyType
public boolean supportsGeographyType()
Description copied from class:ExecutionFactory
If the geography type is supported by the standard ST_ geospatial functions- Overrides:
supportsGeographyType
in classExecutionFactory<ConnectionFactory,WSConnection>
- Returns:
- true if the translator supports the geography type
-
-