|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.translator.ExecutionFactory<F,C>
public class ExecutionFactory<F,C>
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.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)
|
|
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. |
|
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)
|
|
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
|
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 number of values allowed in an IN criteria in the WHERE clause of a query |
|
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. |
|
List<FunctionMethod> |
getPushDownFunctions()
Get a list of FunctionMethod s 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 |
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 |
requiresCriteria()
Whether the source supports queries without criteria. |
|
void |
setImmutable(boolean arg0)
|
|
void |
setMaxDependentInPredicates(int maxDependentInPredicates)
|
|
void |
setMaxInCriteriaSize(int maxInSize)
|
|
void |
setRequiresCriteria(boolean requiresCriteria)
|
|
void |
setSourceRequired(boolean value)
|
|
void |
setSupportedJoinCriteria(ExecutionFactory.SupportedJoinCriteria supportedJoinCriteria)
|
|
void |
setSupportsFullOuterJoins(boolean supportsFullOuterJoins)
|
|
void |
setSupportsInnerJoins(boolean supportsInnerJoins)
|
|
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 |
supportsBatchedUpdates()
Whether the source supports BatchedUpdates |
|
boolean |
supportsBetweenCriteria()
Support indicates connector accepts criteria of form (element BETWEEN constant AND constant) NOT CURRENTLY USED - between is rewritten as compound compare criteria |
|
boolean |
supportsBulkUpdate()
Whether the source supports updates with multiple value sets |
|
boolean |
supportsCaseExpressions()
Support indicates connector can accept queries with non-searched CASE |
|
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 |
supportsCorrelatedSubqueries()
Support indicates connector can accept correlated subqueries wherever subqueries are accepted |
|
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 |
supportsFullOuterJoins()
Support indicates connector can accept full outer joins |
|
boolean |
supportsFunctionsInGroupBy()
Support indicates that the connector supports functions 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 |
supportsInsertWithIterator()
Support indicates that the connector can accept INSERTs with values specified by an Iterator |
|
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 |
supportsNotCriteria()
Support indicates connector accepts logical criteria NOT |
|
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 |
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 |
---|
public static final int DEFAULT_MAX_FROM_GROUPS
public static final int DEFAULT_MAX_IN_CRITERIA_SIZE
Constructor Detail |
---|
public ExecutionFactory()
Method Detail |
---|
public void start() throws TranslatorException
TranslatorException
@TranslatorProperty(display="Is Immutable", description="Is Immutable, True if the source never changes.", advanced=true) public boolean isImmutable()
public void setImmutable(boolean arg0)
public C getConnection(F factory) throws TranslatorException
ConnectionFactory
. Subclasses should override, if they use
another type of connection factory.
factory
-
TranslatorException
getConnection(Object, ExecutionContext)
public C getConnection(F factory, ExecutionContext executionContext) throws TranslatorException
ConnectionFactory
. Subclasses should override, if they use
another type of connection factory or wish to use the ExecutionContext
. By default calls getConnection(Object)
factory
- executionContext
- null if this is a system request for a connection
TranslatorException
public void closeConnection(C connection, F factory)
Connection
. Subclasses should override, if they use
another type of connection.
connection
- factory
- public boolean isSourceRequired()
public void setSourceRequired(boolean value)
public LanguageFactory getLanguageFactory()
public TypeFacility getTypeFacility()
public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
command
- the commandexecutionContext
- Provides information about the context that this command is
executing within, such as the identifiers for the command being executedmetadata
- Access to runtime metadata if needed to translate the commandconnection
- connection factory object to the data source
TranslatorException
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
TranslatorException
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
TranslatorException
public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException
TranslatorException
@TranslatorProperty(display="Supports Select Distinct", description="True, if this connector supports SELECT DISTINCT", advanced=true) public final boolean supportsSelectDistinct()
public void setSupportsSelectDistinct(boolean supportsSelectDistinct)
public boolean supportsSelectExpression()
public boolean supportsAliasedTable()
@TranslatorProperty(display="Supported Join Criteria", description="Returns one of any, theta, equi, or key", advanced=true) public final ExecutionFactory.SupportedJoinCriteria getSupportedJoinCriteria()
ExecutionFactory.SupportedJoinCriteria.ANY
public void setSupportedJoinCriteria(ExecutionFactory.SupportedJoinCriteria supportedJoinCriteria)
@TranslatorProperty(display="Supports Inner Joins", description="True, if this connector supports inner joins", advanced=true) public final boolean supportsInnerJoins()
public void setSupportsInnerJoins(boolean supportsInnerJoins)
public boolean supportsSelfJoins()
supportsAliasedTable()
.
@TranslatorProperty(display="Supports Outer Joins", description="True, if this connector supports outer joins", advanced=true) public final boolean supportsOuterJoins()
public void setSupportsOuterJoins(boolean supportsOuterJoins)
@TranslatorProperty(display="Supports Full Outer Joins", description="True, if this connector supports full outer joins", advanced=true) public final boolean supportsFullOuterJoins()
public void setSupportsFullOuterJoins(boolean supportsFullOuterJoins)
public boolean supportsInlineViews()
public boolean supportsBetweenCriteria()
public boolean supportsCompareCriteriaEquals()
public boolean supportsCompareCriteriaOrdered()
public boolean supportsLikeCriteria()
public boolean supportsLikeCriteriaEscapeCharacter()
public boolean supportsInCriteria()
public boolean supportsInCriteriaSubquery()
public boolean supportsIsNullCriteria()
public boolean supportsOrCriteria()
public boolean supportsNotCriteria()
public boolean supportsExistsCriteria()
public boolean supportsQuantifiedCompareCriteriaSome()
public boolean supportsQuantifiedCompareCriteriaAll()
@TranslatorProperty(display="Supports ORDER BY", description="True, if this connector supports ORDER BY", advanced=true) public final boolean supportsOrderBy()
public void setSupportsOrderBy(boolean supportsOrderBy)
public boolean supportsOrderByUnrelated()
public ExecutionFactory.NullOrder getDefaultNullOrder()
ExecutionFactory.NullOrder
public boolean supportsOrderByNullOrdering()
public boolean supportsGroupBy()
public boolean supportsOnlySingleTableGroupBy()
public boolean supportsHaving()
public boolean supportsAggregatesSum()
public boolean supportsAggregatesAvg()
public boolean supportsAggregatesMin()
public boolean supportsAggregatesMax()
public boolean supportsAggregatesCount()
public boolean supportsAggregatesCountStar()
public boolean supportsAggregatesDistinct()
public boolean supportsAggregatesEnhancedNumeric()
public boolean supportsScalarSubqueries()
public boolean supportsCorrelatedSubqueries()
public boolean supportsCaseExpressions()
public boolean supportsSearchedCaseExpressions()
public boolean supportsUnions()
public boolean supportsSetQueryOrderBy()
public boolean supportsIntersect()
public boolean supportsExcept()
public List<String> getSupportedFunctions()
public List<FunctionMethod> getPushDownFunctions()
FunctionMethod
s 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>
ExecutionFactory#addPushDownFunction(String, String, FunctionParameter, FunctionParameter...)
protected FunctionMethod addPushDownFunction(String qualifier, String name, String returnType, String... paramTypes)
@TranslatorProperty(display="Max number of IN predicate entries", advanced=true) public final int getMaxInCriteriaSize()
public void setMaxInCriteriaSize(int maxInSize)
@TranslatorProperty(display="Max number of dependent values across all IN predicates", advanced=true) public int getMaxDependentInPredicates()
public void setMaxDependentInPredicates(int maxDependentInPredicates)
public boolean supportsFunctionsInGroupBy()
Support indicates that the connector supports functions in GROUP BY, such as:
SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)
public boolean supportsRowLimit()
public boolean supportsRowOffset()
public int getMaxFromGroups()
public boolean useAnsiJoin()
@TranslatorProperty(display="Requries Criteria", description="True, if this connector requires criteria on source queries", advanced=true) public final boolean requiresCriteria()
public void setRequiresCriteria(boolean requiresCriteria)
public boolean supportsBatchedUpdates()
BatchedUpdates
public boolean supportsBulkUpdate()
public boolean supportsInsertWithQueryExpression()
SetQuery
or Select
public boolean supportsInsertWithIterator()
Iterator
public static <T> T getInstance(Class<T> expectedType, String className, Collection<?> ctorObjs, Class<? extends T> defaultClass) throws TranslatorException
TranslatorException
public void getMetadata(MetadataFactory metadataFactory, C conn) throws TranslatorException
metadataFactory
- conn
-
TranslatorException
public boolean areLobsUsableAfterClose()
public boolean supportsCommonTableExpressions()
public boolean supportsAdvancedOlapOperations()
public boolean supportsElementaryOlapOperations()
public boolean supportsWindowOrderByWithAggregates()
public boolean supportsWindowDistinctAggregates()
public boolean supportsArrayAgg()
public boolean supportsSimilarTo()
public boolean supportsLikeRegex()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |