Teiid 8.3.0.Final

org.teiid.translator
Class ExecutionFactory<F,C>

java.lang.Object
  extended by org.teiid.translator.ExecutionFactory<F,C>
Direct Known Subclasses:
BaseDelegatingExecutionFactory, FileExecutionFactory, JDBCExecutionFactory, JPA2ExecutionFactory, LDAPExecutionFactory, ObjectExecutionFactory, ODataExecutionFactory, OlapExecutionFactory, SalesForceExecutionFactory, SpreadsheetExecutionFactory, WSExecutionFactory, YahooExecutionFactory

public class ExecutionFactory<F,C>
extends Object

The primary entry point for a Translator. This class should be extended by the custom translator writer.

The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed the "start" method is called. This class represents the basic capabilities of the translator.


Nested Class Summary
static class ExecutionFactory.Format
           
static class ExecutionFactory.NullOrder
           
static class ExecutionFactory.SupportedJoinCriteria
           
 
Field Summary
static int DEFAULT_MAX_FROM_GROUPS
           
static int DEFAULT_MAX_IN_CRITERIA_SIZE
           
 
Constructor Summary
ExecutionFactory()
           
 
Method Summary
protected  FunctionMethod addPushDownFunction(String qualifier, String name, String returnType, String... paramTypes)
          Adds a pushdown function.
 boolean areLobsUsableAfterClose()
          Indicates if LOBs are usable after the execution is closed.
 void closeConnection(C connection, F factory)
          Closes a connection object from the given connection factory.
 ProcedureExecution createDirectExecution(List<Argument> arguments, Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
           
 Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
          Create an execution object for the specified command
 ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
           
 ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
           
 UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection)
           
 CacheDirective getCacheDirective(Command command, ExecutionContext executionContext, RuntimeMetadata metadata)
          Get the CacheDirective to control command caching.
 C getConnection(F factory)
          Deprecated.  
 C getConnection(F factory, ExecutionContext executionContext)
          Return a connection object from the given connection factory.
 ExecutionFactory.NullOrder getDefaultNullOrder()
          Returns the default null ordering
static
<T> T
getInstance(Class<T> expectedType, String className, Collection<?> ctorObjs, Class<? extends T> defaultClass)
           
 LanguageFactory getLanguageFactory()
          Obtain a reference to the default LanguageFactory that can be used to construct new language interface objects.
 int getMaxDependentInPredicates()
          Get the integer value representing the max number of dependent IN predicates.
 int getMaxFromGroups()
          The number of groups supported in the from clause.
 int getMaxInCriteriaSize()
          Get the integer value representing the number of values allowed in an IN criteria in the WHERE clause of a query
 void getMetadata(MetadataFactory metadataFactory, C conn)
          Implement to provide metadata to the metadata for use by the engine.
 String getNativeQueryProcedureName()
          Defines the name of the procedure that need to be treated as "native" query processing procedure.
 List<FunctionMethod> getPushDownFunctions()
          Get a list of FunctionMethods that will be contributed to the SYS schema.
 List<String> getSupportedFunctions()
          Get list of all supported function names.
 ExecutionFactory.SupportedJoinCriteria getSupportedJoinCriteria()
          Get the supported join criteria.
 TypeFacility getTypeFacility()
          Obtain a reference to the type facility, which can be used to perform many type conversions supplied by the Connector API.
 boolean isCopyLobs()
           
 boolean isForkable()
          When forkable the engine may use a separate thread to interact with returned Execution.
 boolean isImmutable()
          Defines if the Connector is read-only connector
 boolean isSourceRequired()
          Flag that indicates if a underlying source connection required for this execution factory to work
 boolean isSourceRequiredForMetadata()
          Flag that indicates if a underlying source connection required for this execution factory to return metadata
 boolean requiresCriteria()
          Whether the source supports queries without criteria.
 void setCopyLobs(boolean copyLobs)
           
 void setImmutable(boolean arg0)
           
 void setMaxDependentInPredicates(int maxDependentInPredicates)
           
 void setMaxInCriteriaSize(int maxInSize)
           
 void setNativeQueryProcedureName(String name)
           
 void setRequiresCriteria(boolean requiresCriteria)
           
 void setSourceRequired(boolean value)
           
 void setSourceRequiredForMetadata(boolean sourceRequiredForMetadata)
           
 void setSupportedJoinCriteria(ExecutionFactory.SupportedJoinCriteria supportedJoinCriteria)
           
 void setSupportsFullOuterJoins(boolean supportsFullOuterJoins)
           
 void setSupportsInnerJoins(boolean supportsInnerJoins)
           
 void setSupportsNativeQueries(boolean state)
           
 void setSupportsOrderBy(boolean supportsOrderBy)
           
 void setSupportsOuterJoins(boolean supportsOuterJoins)
           
 void setSupportsSelectDistinct(boolean supportsSelectDistinct)
           
 void start()
          Initialize the connector with supplied configuration
 boolean supportsAdvancedOlapOperations()
           
 boolean supportsAggregatesAvg()
          Support indicates connector can accept the AVG aggregate function
 boolean supportsAggregatesCount()
          Support indicates connector can accept the COUNT aggregate function
 boolean supportsAggregatesCountStar()
          Support indicates connector can accept the COUNT(*) aggregate function
 boolean supportsAggregatesDistinct()
          Support indicates connector can accept DISTINCT within aggregate functions
 boolean supportsAggregatesEnhancedNumeric()
          Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP
 boolean supportsAggregatesMax()
          Support indicates connector can accept the MAX aggregate function
 boolean supportsAggregatesMin()
          Support indicates connector can accept the MIN aggregate function
 boolean supportsAggregatesSum()
          Support indicates connector can accept the SUM aggregate function
 boolean supportsAliasedTable()
          Support indicates connector can accept groups with aliases
 boolean supportsArrayAgg()
           
 boolean supportsArrayType()
          The engine currently uses array types for dependent joins.
 boolean supportsBatchedUpdates()
          Whether the source supports BatchedUpdates
 boolean supportsBulkUpdate()
          Whether the source supports updates with multiple value sets
 boolean supportsCommonTableExpressions()
           
 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 supportsConvert(int fromType, int toType)
          Used for fine grained control of convert/cast pushdown.
 boolean supportsCorrelatedSubqueries()
          Support indicates connector can accept correlated subqueries wherever subqueries are accepted
 boolean supportsDependentJoins()
           
 boolean supportsElementaryOlapOperations()
           
 boolean supportsExcept()
          Support indicates that the connector supports the EXCEPT of two queries.
 boolean supportsExistsCriteria()
          Support indicates connector accepts the EXISTS criteria
 boolean supportsFormatLiteral(String literal, ExecutionFactory.Format format)
           
 boolean supportsFullOuterJoins()
          Support indicates connector can accept full outer joins
 boolean supportsFunctionsInGroupBy()
          Support indicates that the connector supports non-column expressions in GROUP BY, such as: SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)
 boolean supportsGroupBy()
          Whether the source supports an explicit GROUP BY clause
 boolean supportsHaving()
          Whether the source supports the HAVING clause
 boolean supportsInCriteria()
          Support indicates connector accepts criteria of form (element IN set)
 boolean supportsInCriteriaSubquery()
          Support indicates connector accepts IN criteria with a subquery on the right side
 boolean supportsInlineViews()
          Support indicates connector can accept inline views (subqueries in the FROM clause).
 boolean supportsInnerJoins()
          Support indicates connector can accept inner or cross joins
 boolean supportsInsertWithQueryExpression()
          Support indicates that the connector can accept INSERTs with values specified by a SetQuery or Select
 boolean supportsIntersect()
          Support indicates that the connector supports the INTERSECT of two queries.
 boolean supportsIsNullCriteria()
          Support indicates connector accepts criteria of form (element IS NULL)
 boolean supportsLikeCriteria()
          Support indicates connector accepts criteria of form (element LIKE constant)
 boolean supportsLikeCriteriaEscapeCharacter()
          Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)
 boolean supportsLikeRegex()
           
 boolean supportsNativeQueries()
          True, if this translator supports execution of source specific commands unaltered through 'native' procedure.
 boolean supportsNotCriteria()
          Support indicates connector accepts logical criteria NOT
 boolean supportsOnlyCorrelatedSubqueries()
           
 boolean supportsOnlyFormatLiterals()
          See also supportsFormatLiteral(String, Format)
 boolean supportsOnlyLiteralComparison()
           
 boolean supportsOnlySingleTableGroupBy()
          Whether the source supports grouping only over a single table
 boolean supportsOrCriteria()
          Support indicates connector accepts logical criteria connected by OR
 boolean supportsOrderBy()
          Support indicates connector accepts ORDER BY clause, including multiple elements and ascending and descending sorts.
 boolean supportsOrderByNullOrdering()
          Returns whether the database supports explicit join ordering.
 boolean supportsOrderByUnrelated()
          Support indicates connector accepts ORDER BY clause with columns not from the select
 boolean supportsOuterJoins()
          Support indicates connector can accept left outer joins
 boolean supportsQuantifiedCompareCriteriaAll()
          Support indicates connector accepts the quantified comparison criteria that use ALL
 boolean supportsQuantifiedCompareCriteriaSome()
          Support indicates connector accepts the quantified comparison criteria that use SOME
 boolean 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 query
 boolean supportsScalarSubqueries()
          Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and HAVING clauses
 boolean supportsSearchedCaseExpressions()
          Support indicates connector can accept queries with searched CASE WHEN ...
 boolean supportsSelectDistinct()
          Support indicates connector can accept queries with SELECT DISTINCT
 boolean supportsSelectExpression()
          Support indicates connector can accept expressions other than element symbols in the SELECT clause.
 boolean supportsSelfJoins()
          Support indicates connector can accept self-joins where a group is joined to itself with aliases.
 boolean supportsSetQueryOrderBy()
          Support indicates that the connector supports an ORDER BY on a SetQuery.
 boolean supportsSimilarTo()
           
 boolean supportsSubqueryInOn()
          Refines subquery support.
 boolean supportsUnions()
          Support indicates that the connector supports the UNION of two queries.
 boolean supportsWindowDistinctAggregates()
           
 boolean supportsWindowOrderByWithAggregates()
           
 boolean useAnsiJoin()
          Whether the source prefers to use ANSI style joins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_FROM_GROUPS

public static final int DEFAULT_MAX_FROM_GROUPS
See Also:
Constant Field Values

DEFAULT_MAX_IN_CRITERIA_SIZE

public static final int DEFAULT_MAX_IN_CRITERIA_SIZE
See Also:
Constant Field Values
Constructor Detail

ExecutionFactory

public ExecutionFactory()
Method Detail

start

public void start()
           throws TranslatorException
Initialize the connector with supplied configuration

Throws:
TranslatorException

isImmutable

@TranslatorProperty(display="Is Immutable",
                    description="Is Immutable, True if the source never changes.",
                    advanced=true)
public boolean isImmutable()
Defines if the Connector is read-only connector

Returns:

setImmutable

public void setImmutable(boolean arg0)

isCopyLobs

@TranslatorProperty(display="Copy LOBs",
                    description="If true, returned LOBs will be copied, rather than streamed from the source",
                    advanced=true)
public boolean isCopyLobs()

setCopyLobs

public void setCopyLobs(boolean copyLobs)

getConnection

public C getConnection(F factory)
                throws TranslatorException
Deprecated. 

Return a connection object from the given connection factory. The default implementation assumes a JCA ConnectionFactory. Subclasses should override, if they use another type of connection factory.

Parameters:
factory -
Returns:
a connection
Throws:
TranslatorException
See Also:
getConnection(Object, ExecutionContext)

getConnection

public C getConnection(F factory,
                       ExecutionContext executionContext)
                throws TranslatorException
Return a connection object from the given connection factory. The default implementation assumes a JCA ConnectionFactory. Subclasses should override, if they use another type of connection factory or wish to use the ExecutionContext. By default calls getConnection(Object)

Parameters:
factory -
executionContext - null if this is a system request for a connection
Returns:
a connection
Throws:
TranslatorException

closeConnection

public void closeConnection(C connection,
                            F factory)
Closes a connection object from the given connection factory. The default implementation assumes a JCA Connection. Subclasses should override, if they use another type of connection.

Parameters:
connection -
factory -

isSourceRequired

public boolean isSourceRequired()
Flag that indicates if a underlying source connection required for this execution factory to work

Returns:

setSourceRequired

public void setSourceRequired(boolean value)

isSourceRequiredForMetadata

public boolean isSourceRequiredForMetadata()
Flag that indicates if a underlying source connection required for this execution factory to return metadata

Returns:
Boolean.TRUE if required, null if possibly required, or Boolean.FALSE if not required

setSourceRequiredForMetadata

public void setSourceRequiredForMetadata(boolean sourceRequiredForMetadata)

getLanguageFactory

public LanguageFactory getLanguageFactory()
Obtain a reference to the default LanguageFactory that can be used to construct new language interface objects. This is typically needed when modifying the language objects passed to the connector or for testing when objects need to be created.


getTypeFacility

public TypeFacility getTypeFacility()
Obtain a reference to the type facility, which can be used to perform many type conversions supplied by the Connector API.


createExecution

public Execution createExecution(Command command,
                                 ExecutionContext executionContext,
                                 RuntimeMetadata metadata,
                                 C connection)
                          throws TranslatorException
Create an execution object for the specified command

Parameters:
command - the command
executionContext - Provides information about the context that this command is executing within, such as the identifiers for the command being executed
metadata - Access to runtime metadata if needed to translate the command
connection - connection factory object to the data source
Returns:
An execution object that can use to execute the command
Throws:
TranslatorException

createResultSetExecution

public ResultSetExecution createResultSetExecution(QueryExpression command,
                                                   ExecutionContext executionContext,
                                                   RuntimeMetadata metadata,
                                                   C connection)
                                            throws TranslatorException
Throws:
TranslatorException

createProcedureExecution

public ProcedureExecution createProcedureExecution(Call command,
                                                   ExecutionContext executionContext,
                                                   RuntimeMetadata metadata,
                                                   C connection)
                                            throws TranslatorException
Throws:
TranslatorException

createUpdateExecution

public UpdateExecution createUpdateExecution(Command command,
                                             ExecutionContext executionContext,
                                             RuntimeMetadata metadata,
                                             C connection)
                                      throws TranslatorException
Throws:
TranslatorException

createDirectExecution

public ProcedureExecution createDirectExecution(List<Argument> arguments,
                                                Command command,
                                                ExecutionContext executionContext,
                                                RuntimeMetadata metadata,
                                                C connection)
                                         throws TranslatorException
Throws:
TranslatorException

supportsSelectDistinct

@TranslatorProperty(display="Supports Select Distinct",
                    description="True, if this connector supports SELECT DISTINCT",
                    advanced=true)
public boolean supportsSelectDistinct()
Support indicates connector can accept queries with SELECT DISTINCT

Since:
3.1 SP2

setSupportsSelectDistinct

public void setSupportsSelectDistinct(boolean supportsSelectDistinct)

supportsSelectExpression

public boolean supportsSelectExpression()
Support indicates connector can accept expressions other than element symbols in the SELECT clause. Specific supports for the expression type are still checked.

Since:
6.1.0

supportsAliasedTable

public boolean supportsAliasedTable()
Support indicates connector can accept groups with aliases

Since:
3.1 SP2

getSupportedJoinCriteria

@TranslatorProperty(display="Supported Join Criteria",
                    description="Returns one of any, theta, equi, or key",
                    advanced=true)
public ExecutionFactory.SupportedJoinCriteria getSupportedJoinCriteria()
Get the supported join criteria. A null return value will be treated as ExecutionFactory.SupportedJoinCriteria.ANY

Since:
6.1.0

setSupportedJoinCriteria

public void setSupportedJoinCriteria(ExecutionFactory.SupportedJoinCriteria supportedJoinCriteria)

supportsInnerJoins

@TranslatorProperty(display="Supports Inner Joins",
                    description="True, if this connector supports inner joins",
                    advanced=true)
public boolean supportsInnerJoins()
Support indicates connector can accept inner or cross joins

Since:
6.1.0

setSupportsInnerJoins

public void setSupportsInnerJoins(boolean supportsInnerJoins)

supportsSelfJoins

public boolean supportsSelfJoins()
Support indicates connector can accept self-joins where a group is joined to itself with aliases. Connector must also support supportsAliasedTable().

Since:
3.1 SP2

supportsOuterJoins

@TranslatorProperty(display="Supports Outer Joins",
                    description="True, if this connector supports outer joins",
                    advanced=true)
public boolean supportsOuterJoins()
Support indicates connector can accept left outer joins

Since:
3.1 SP2

setSupportsOuterJoins

public void setSupportsOuterJoins(boolean supportsOuterJoins)

supportsFullOuterJoins

@TranslatorProperty(display="Supports Full Outer Joins",
                    description="True, if this connector supports full outer joins",
                    advanced=true)
public boolean supportsFullOuterJoins()
Support indicates connector can accept full outer joins

Since:
3.1 SP2

setSupportsFullOuterJoins

public void setSupportsFullOuterJoins(boolean supportsFullOuterJoins)

supportsInlineViews

public boolean supportsInlineViews()
Support indicates connector can accept inline views (subqueries in the FROM clause).

Since:
4.1

supportsCompareCriteriaEquals

public boolean supportsCompareCriteriaEquals()
Support indicates connector accepts criteria of form (element = constant)

Since:
3.1 SP2

supportsCompareCriteriaOrdered

public 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.

Since:
3.1 SP2

supportsLikeCriteria

public boolean supportsLikeCriteria()
Support indicates connector accepts criteria of form (element LIKE constant)

Since:
3.1 SP2

supportsLikeCriteriaEscapeCharacter

public boolean supportsLikeCriteriaEscapeCharacter()
Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)

Since:
3.1 SP2

supportsInCriteria

public boolean supportsInCriteria()
Support indicates connector accepts criteria of form (element IN set)

Since:
3.1 SP2

supportsInCriteriaSubquery

public boolean supportsInCriteriaSubquery()
Support indicates connector accepts IN criteria with a subquery on the right side

Since:
4.0

supportsIsNullCriteria

public boolean supportsIsNullCriteria()
Support indicates connector accepts criteria of form (element IS NULL)

Since:
3.1 SP2

supportsOrCriteria

public boolean supportsOrCriteria()
Support indicates connector accepts logical criteria connected by OR

Since:
3.1 SP2

supportsNotCriteria

public boolean supportsNotCriteria()
Support indicates connector accepts logical criteria NOT

Since:
3.1 SP2

supportsExistsCriteria

public boolean supportsExistsCriteria()
Support indicates connector accepts the EXISTS criteria

Since:
4.0

supportsQuantifiedCompareCriteriaSome

public boolean supportsQuantifiedCompareCriteriaSome()
Support indicates connector accepts the quantified comparison criteria that use SOME

Since:
4.0

supportsQuantifiedCompareCriteriaAll

public boolean supportsQuantifiedCompareCriteriaAll()
Support indicates connector accepts the quantified comparison criteria that use ALL

Since:
4.0

supportsOrderBy

@TranslatorProperty(display="Supports ORDER BY",
                    description="True, if this connector supports ORDER BY",
                    advanced=true)
public boolean supportsOrderBy()
Support indicates connector accepts ORDER BY clause, including multiple elements and ascending and descending sorts.

Since:
3.1 SP2

setSupportsOrderBy

public void setSupportsOrderBy(boolean supportsOrderBy)

supportsOrderByUnrelated

public boolean supportsOrderByUnrelated()
Support indicates connector accepts ORDER BY clause with columns not from the select

Returns:
Since:
6.2

getDefaultNullOrder

public ExecutionFactory.NullOrder getDefaultNullOrder()
Returns the default null ordering

Returns:
the ExecutionFactory.NullOrder
Since:
7.1

supportsOrderByNullOrdering

public boolean supportsOrderByNullOrdering()
Returns whether the database supports explicit join ordering.

Returns:
true if nulls first/last can be specified
Since:
7.1

supportsGroupBy

public boolean supportsGroupBy()
Whether the source supports an explicit GROUP BY clause

Since:
6.1

supportsOnlySingleTableGroupBy

public boolean supportsOnlySingleTableGroupBy()
Whether the source supports grouping only over a single table

Returns:

supportsHaving

public boolean supportsHaving()
Whether the source supports the HAVING clause

Since:
6.1

supportsAggregatesSum

public boolean supportsAggregatesSum()
Support indicates connector can accept the SUM aggregate function

Since:
3.1 SP2

supportsAggregatesAvg

public boolean supportsAggregatesAvg()
Support indicates connector can accept the AVG aggregate function

Since:
3.1 SP2

supportsAggregatesMin

public boolean supportsAggregatesMin()
Support indicates connector can accept the MIN aggregate function

Since:
3.1 SP2

supportsAggregatesMax

public boolean supportsAggregatesMax()
Support indicates connector can accept the MAX aggregate function

Since:
3.1 SP2

supportsAggregatesCount

public boolean supportsAggregatesCount()
Support indicates connector can accept the COUNT aggregate function

Since:
3.1 SP2

supportsAggregatesCountStar

public boolean supportsAggregatesCountStar()
Support indicates connector can accept the COUNT(*) aggregate function

Since:
3.1 SP2

supportsAggregatesDistinct

public boolean supportsAggregatesDistinct()
Support indicates connector can accept DISTINCT within aggregate functions

Since:
3.1 SP2

supportsAggregatesEnhancedNumeric

public boolean supportsAggregatesEnhancedNumeric()
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP

Since:
7.1

supportsScalarSubqueries

public boolean supportsScalarSubqueries()
Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and HAVING clauses

Since:
4.0

supportsCorrelatedSubqueries

public boolean supportsCorrelatedSubqueries()
Support indicates connector can accept correlated subqueries wherever subqueries are accepted

Since:
4.0

supportsSearchedCaseExpressions

public boolean supportsSearchedCaseExpressions()
Support indicates connector can accept queries with searched CASE WHEN ... END

Since:
4.0

supportsUnions

public boolean supportsUnions()
Support indicates that the connector supports the UNION of two queries.

Since:
4.2

supportsSetQueryOrderBy

public boolean supportsSetQueryOrderBy()
Support indicates that the connector supports an ORDER BY on a SetQuery.

Since:
5.6

supportsIntersect

public boolean supportsIntersect()
Support indicates that the connector supports the INTERSECT of two queries.

Since:
5.6

supportsExcept

public boolean supportsExcept()
Support indicates that the connector supports the EXCEPT of two queries.

Since:
5.6

getSupportedFunctions

public List<String> getSupportedFunctions()
Get list of all supported function names. Arithmetic functions have names like "+".

Since:
3.1 SP3
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.

getPushDownFunctions

public List<FunctionMethod> getPushDownFunctions()
Get a list of FunctionMethods that will be contributed to the SYS schema. To avoid conflicts with system functions, the function name should contain a qualifier - typically <translator name>.<function name>

Returns:
See Also:
ExecutionFactory#addPushDownFunction(String, String, FunctionParameter, FunctionParameter...)

addPushDownFunction

protected FunctionMethod addPushDownFunction(String qualifier,
                                             String name,
                                             String returnType,
                                             String... paramTypes)
Adds a pushdown function.

Parameters:
qualifier - will be pre-pended to the name
name -
returnType - see TypeFacility.RUNTIME_NAMES for type names
paramTypes - see TypeFacility.RUNTIME_NAMES for type names
Returns:
the FunctionMethod created.

getMaxInCriteriaSize

@TranslatorProperty(display="Max number of IN predicate entries",
                    advanced=true)
public int getMaxInCriteriaSize()
Get the integer value representing the number of values allowed in an IN criteria in the WHERE clause of a query

Since:
5.0

setMaxInCriteriaSize

public void setMaxInCriteriaSize(int maxInSize)

getMaxDependentInPredicates

@TranslatorProperty(display="Max number of dependent IN predicates",
                    advanced=true)
public int getMaxDependentInPredicates()
Get the integer value representing the max number of dependent IN predicates. This may be used to split a single dependent value via OR, or multiple dependent values via AND.


setMaxDependentInPredicates

public void setMaxDependentInPredicates(int maxDependentInPredicates)

supportsFunctionsInGroupBy

public boolean supportsFunctionsInGroupBy()

Support indicates that the connector supports non-column expressions in GROUP BY, such as: SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)

Since:
5.0

supportsRowLimit

public boolean supportsRowLimit()
Gets whether the connector can limit the number of rows returned by a query.

Since:
5.0 SP1

supportsRowOffset

public 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 query

Since:
5.0 SP1

getMaxFromGroups

public int getMaxFromGroups()
The number of groups supported in the from clause. Added for a Sybase limitation.

Returns:
the number of groups supported in the from clause, or -1 if there is no limit
Since:
5.6

useAnsiJoin

public boolean useAnsiJoin()
Whether the source prefers to use ANSI style joins.

Since:
6.0

requiresCriteria

@TranslatorProperty(display="Requries Criteria",
                    description="True, if this connector requires criteria on source queries",
                    advanced=true)
public boolean requiresCriteria()
Whether the source supports queries without criteria.

Since:
6.0

setRequiresCriteria

public void setRequiresCriteria(boolean requiresCriteria)

supportsBatchedUpdates

public boolean supportsBatchedUpdates()
Whether the source supports BatchedUpdates

Since:
6.0

supportsBulkUpdate

public boolean supportsBulkUpdate()
Whether the source supports updates with multiple value sets

Since:
6.0

supportsInsertWithQueryExpression

public boolean supportsInsertWithQueryExpression()
Support indicates that the connector can accept INSERTs with values specified by a SetQuery or Select

Since:
6.1

getInstance

public static <T> T getInstance(Class<T> expectedType,
                                String className,
                                Collection<?> ctorObjs,
                                Class<? extends T> defaultClass)
                     throws TranslatorException
Throws:
TranslatorException

getMetadata

public void getMetadata(MetadataFactory metadataFactory,
                        C conn)
                 throws TranslatorException
Implement to provide metadata to the metadata for use by the engine. This is the primary method of creating metadata for dynamic VDBs.

Parameters:
metadataFactory -
conn - may be null if the source is not required
Throws:
TranslatorException - to indicate a recoverable error, otherwise a RuntimeException
See Also:
isSourceRequiredForMetadata()

areLobsUsableAfterClose

public boolean areLobsUsableAfterClose()
Indicates if LOBs are usable after the execution is closed.

Returns:
true if LOBs can be used after close
Since:
7.2

supportsCommonTableExpressions

public boolean supportsCommonTableExpressions()
Returns:
true if the WITH clause is supported
Since:
7.2

supportsAdvancedOlapOperations

public boolean supportsAdvancedOlapOperations()
Returns:
true if Advanced OLAP operations are supported including the aggregate function filter clause.
Since:
7.5

supportsElementaryOlapOperations

public boolean supportsElementaryOlapOperations()
Returns:
true if Elementary OLAP operations are supported including window functions and inline window specifications that include simple expressions in partitioning and ordering
Since:
7.5

supportsWindowOrderByWithAggregates

public boolean supportsWindowOrderByWithAggregates()
Returns:
true if all aggregates can have window function order by clauses.
Since:
7.5

supportsWindowDistinctAggregates

public boolean supportsWindowDistinctAggregates()
Returns:
true if distinct aggregates can be windowed function.
Since:
7.6

supportsArrayAgg

public boolean supportsArrayAgg()
Returns:
true if array_agg is supported
Since:
7.5

supportsSimilarTo

public boolean supportsSimilarTo()
Returns:
true if the SIMILAR TO predicate is supported
Since:
7.5

supportsLikeRegex

public boolean supportsLikeRegex()
Returns:
true if the LIKE_REGEX predicate is supported
Since:
7.4

supportsConvert

public boolean supportsConvert(int fromType,
                               int toType)
Used for fine grained control of convert/cast pushdown. The getSupportedFunctions() should contain SourceSystemFunctions.CONVERT. This method can then return false to indicate a lack of specific support. The engine will does not care about an unnecessary conversion where fromType == toType. By default lob conversion is disabled.

Parameters:
fromType - @see RUNTIME_CODES
toType - @see RUNTIME_CODES
Returns:
true if the given conversion is supported.
Since:
8.0

supportsOnlyLiteralComparison

public boolean supportsOnlyLiteralComparison()
Returns:
true if only Literal comparisons (equality, ordered, like, etc.) are supported for non-join conditions.
Since:
8.0

supportsDependentJoins

public boolean supportsDependentJoins()
Returns:
true if dependent join pushdown is supported
Since:
8.0

supportsOnlyFormatLiterals

public boolean supportsOnlyFormatLiterals()
See also supportsFormatLiteral(String, Format)

Returns:
true if only literal formats are supports.

supportsFormatLiteral

public boolean supportsFormatLiteral(String literal,
                                     ExecutionFactory.Format format)
Parameters:
literal -
format -
Returns:
true if the given Java format string is supported

supportsSubqueryInOn

public boolean supportsSubqueryInOn()
Refines subquery support.

Returns:
true if subqueries are supported in the on clause.

getCacheDirective

public CacheDirective getCacheDirective(Command command,
                                        ExecutionContext executionContext,
                                        RuntimeMetadata metadata)
                                 throws TranslatorException
Get the CacheDirective to control command caching.

Use CacheDirective.Scope.NONE to indicate to the engine that no caching should be performed by the engine.

If cache parameters on the CacheDirective will be changed by the Execution, then a new instance of a CacheDirective should be set each time.

Parameters:
command -
executionContext -
metadata -
Throws:
TranslatorException

isForkable

public boolean isForkable()
When forkable the engine may use a separate thread to interact with returned Execution.

Returns:
true if Executions can be called in separate threads from the processing thread

supportsArrayType

public boolean supportsArrayType()
The engine currently uses array types for dependent joins.

Returns:
true if an array type is supported.

supportsNativeQueries

@TranslatorProperty(display="Supports Native Queries",
                    description="True, if this translator supports execution of source specific commands unaltered through a \'native\' procedure",
                    advanced=true)
public boolean supportsNativeQueries()
True, if this translator supports execution of source specific commands unaltered through 'native' procedure.

Returns:

setSupportsNativeQueries

public void setSupportsNativeQueries(boolean state)

getNativeQueryProcedureName

@TranslatorProperty(display="Name of the native query",
                    description="The name of the direct query procedure",
                    advanced=true)
public String getNativeQueryProcedureName()
Defines the name of the procedure that need to be treated as "native" query processing procedure. This metadata or signature of the procedure is defined automatically.

Returns:

setNativeQueryProcedureName

public void setNativeQueryProcedureName(String name)

supportsOnlyCorrelatedSubqueries

public boolean supportsOnlyCorrelatedSubqueries()
Returns:
true if only correlated subqueries are supported.

Teiid 8.3.0.Final

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.