Package org.teiid.translator.salesforce
Class SalesForceExecutionFactory
- java.lang.Object
-
- org.teiid.translator.ExecutionFactory<ConnectionFactory,SalesforceConnection>
-
- org.teiid.translator.salesforce.SalesForceExecutionFactory
-
- Direct Known Subclasses:
SalesForce34ExecutionFactory,SalesForce41ExecutionFactory
@Translator(name="salesforce", description="A translator for Salesforce") public class SalesForceExecutionFactory extends ExecutionFactory<ConnectionFactory,SalesforceConnection>
-
-
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 intMAX_RETRIEVE-
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 SalesForceExecutionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.sforce.soap.partner.QueryResultbuildQueryResult(com.sforce.soap.partner.sobject.SObject[] objects)ProcedureExecutioncreateDirectExecution(List<Argument> arguments, Command command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection)ProcedureExecutioncreateProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection)ResultSetExecutioncreateResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection)UpdateExecutioncreateUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection)ExecutionFactory.NullOrdergetDefaultNullOrder()Returns the default null orderingintgetMaxBulkInsertBatchSize()intgetMaxFromGroups()The number of groups supported in the from clause.MetadataProcessor<SalesforceConnection>getMetadataProcessor()Get a MetadataProcessor for the translator to read the metadata.List<String>getSupportedFunctions()Get list of all supported function names.voidsetMaxBulkInsertBatchSize(int maxInsertBatchSize)voidsetMaxFromGroups(int maxFromGroups)voidsetSupportsGroupBy(boolean supportsGroupBy)voidsetUseBulk(boolean bulk)voidsetUseHardDelete(boolean hardDelete)voidstart()Initialize the connector with supplied configurationbooleansupportsAggregatesAvg()Support indicates connector can accept the AVG aggregate functionbooleansupportsAggregatesCount()Support indicates connector can accept the COUNT aggregate functionbooleansupportsAggregatesCountStar()Support indicates connector can accept the COUNT(*) aggregate functionbooleansupportsAggregatesMax()Support indicates connector can accept the MAX aggregate functionbooleansupportsAggregatesMin()Support indicates connector can accept the MIN aggregate functionbooleansupportsAggregatesSum()Support indicates connector can accept the SUM aggregate functionbooleansupportsAliasedTable()Support indicates connector can accept groups with aliasesbooleansupportsBulkUpdate()Whether the source supports updates with multiple value setsbooleansupportsCompareCriteriaEquals()Support indicates connector accepts criteria of form (element = constant)booleansupportsCompareCriteriaOrdered()Support indicates connector accepts criteria of form (element <=|>= constant)
The query engine will may pushdown queries containing < or > if NOT is also supported.booleansupportsGroupBy()Whether the source supports an explicit GROUP BY clausebooleansupportsHaving()Whether the source supports the HAVING clausebooleansupportsInCriteria()Support indicates connector accepts criteria of form (element IN set)booleansupportsIsNullCriteria()Support indicates connector accepts criteria of form (element IS NULL)booleansupportsLikeCriteria()Support indicates connector accepts criteria of form (element LIKE constant)booleansupportsNotCriteria()Support indicates connector accepts logical criteria NOTbooleansupportsOnlyLiteralComparison()booleansupportsOnlyRelationshipStyleJoins()booleansupportsOnlySingleTableGroupBy()Whether the source supports grouping only over a single tablebooleansupportsOrCriteria()Support indicates connector accepts logical criteria connected by ORbooleansupportsOrderByNullOrdering()Returns whether the database supports explicit null ordering.booleansupportsRowLimit()Gets whether the connector can limit the number of rows returned by a query.booleansupportsSelfJoins()Support indicates connector can accept self-joins where a group is joined to itself with aliases.booleansupportsUpsert()booleanuseAnsiJoin()Whether the source prefers to use ANSI style joins.booleanuseBulk()booleanuseHardDelete()-
Methods inherited from class org.teiid.translator.ExecutionFactory
addPushDownFunction, areLobsUsableAfterClose, closeConnection, createExecution, getCacheDirective, getCollationLocale, getConnection, getConnection, getDirectQueryProcedureName, getExcludedCommonTableExpressionName, getInstance, getLanguageFactory, getMaxDependentInPredicates, getMaxInCriteriaSize, getMaxProjectedColumns, getMetadata, 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, supportsAggregatesCountBig, supportsAggregatesDistinct, supportsAggregatesEnhancedNumeric, supportsArrayAgg, supportsArrayType, supportsBatchedUpdates, supportsCommonTableExpressions, supportsCompareCriteriaOrderedExclusive, supportsConvert, supportsCorrelatedSubqueries, supportsCorrelatedSubqueryLimit, supportsDependentJoins, supportsDirectQueryProcedure, supportsElementaryOlapOperations, supportsExcept, supportsExistsCriteria, supportsFormatLiteral, supportsFullDependentJoins, supportsFullOuterJoins, supportsFunctionsInGroupBy, supportsGeographyType, supportsGroupByMultipleDistinctAggregates, supportsGroupByRollup, supportsInCriteriaSubquery, supportsInlineViews, supportsInnerJoins, supportsInsertWithQueryExpression, supportsIntersect, supportsIsDistinctCriteria, supportsLateralJoin, supportsLateralJoinCondition, supportsLikeCriteriaEscapeCharacter, supportsLikeRegex, supportsListAgg, supportsMultipleOpenExecutions, supportsNativeQueries, supportsOnlyCorrelatedSubqueries, supportsOnlyFormatLiterals, supportsOnlyLateralJoinProcedure, supportsOnlyTimestampAddLiteral, supportsOrderBy, supportsOrderByUnrelated, supportsOrderByWithExtendedGrouping, supportsOuterJoins, supportsPartialFiltering, supportsProcedureParameterExpression, supportsProcedureTable, supportsQuantifiedCompareCriteriaAll, supportsQuantifiedCompareCriteriaSome, supportsRecursiveCommonTableExpressions, supportsRowOffset, supportsScalarSubqueries, supportsScalarSubqueryProjection, supportsSearchedCaseExpressions, supportsSelectDistinct, supportsSelectExpression, supportsSelectExpressionArrayType, supportsSelectWithoutFrom, supportsSetQueryLimitOffset, supportsSetQueryOrderBy, supportsSimilarTo, supportsStringAgg, supportsSubqueryCommonTableExpressions, supportsSubqueryInOn, supportsUnions, supportsWindowDistinctAggregates, supportsWindowFrameClause, supportsWindowFunctionCumeDist, supportsWindowFunctionNthValue, supportsWindowFunctionNtile, supportsWindowFunctionPercentRank, supportsWindowOrderByWithAggregates, useBindingsForDependentJoin
-
-
-
-
Field Detail
-
MAX_RETRIEVE
public static final int MAX_RETRIEVE
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start() throws TranslatorExceptionDescription copied from class:ExecutionFactoryInitialize the connector with supplied configuration- Overrides:
startin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Throws:
TranslatorException
-
createResultSetExecution
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection) throws TranslatorException
- Overrides:
createResultSetExecutionin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Throws:
TranslatorException
-
createUpdateExecution
public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection) throws TranslatorException
- Overrides:
createUpdateExecutionin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Throws:
TranslatorException
-
createProcedureExecution
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection) throws TranslatorException
- Overrides:
createProcedureExecutionin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Throws:
TranslatorException
-
createDirectExecution
public ProcedureExecution createDirectExecution(List<Argument> arguments, Command command, ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection) throws TranslatorException
- Overrides:
createDirectExecutionin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Throws:
TranslatorException
-
getMetadataProcessor
public MetadataProcessor<SalesforceConnection> getMetadataProcessor()
Description copied from class:ExecutionFactoryGet a MetadataProcessor for the translator to read the metadata. Typically this will return a new instance.- Overrides:
getMetadataProcessorin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Returns:
-
getSupportedFunctions
public List<String> getSupportedFunctions()
Description copied from class:ExecutionFactoryGet list of all supported function names. Arithmetic functions have names like "+".- Overrides:
getSupportedFunctionsin classExecutionFactory<ConnectionFactory,SalesforceConnection>- 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.
-
supportsCompareCriteriaEquals
public boolean supportsCompareCriteriaEquals()
Description copied from class:ExecutionFactorySupport indicates connector accepts criteria of form (element = constant)- Overrides:
supportsCompareCriteriaEqualsin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsInCriteria
public boolean supportsInCriteria()
Description copied from class:ExecutionFactorySupport indicates connector accepts criteria of form (element IN set)- Overrides:
supportsInCriteriain classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsLikeCriteria
public boolean supportsLikeCriteria()
Description copied from class:ExecutionFactorySupport indicates connector accepts criteria of form (element LIKE constant)- Overrides:
supportsLikeCriteriain classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsRowLimit
public boolean supportsRowLimit()
Description copied from class:ExecutionFactoryGets whether the connector can limit the number of rows returned by a query.- Overrides:
supportsRowLimitin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsAggregatesCountStar
public boolean supportsAggregatesCountStar()
Description copied from class:ExecutionFactorySupport indicates connector can accept the COUNT(*) aggregate function- Overrides:
supportsAggregatesCountStarin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsAggregatesCount
public boolean supportsAggregatesCount()
Description copied from class:ExecutionFactorySupport indicates connector can accept the COUNT aggregate function- Overrides:
supportsAggregatesCountin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsAggregatesMax
public boolean supportsAggregatesMax()
Description copied from class:ExecutionFactorySupport indicates connector can accept the MAX aggregate function- Overrides:
supportsAggregatesMaxin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsAggregatesMin
public boolean supportsAggregatesMin()
Description copied from class:ExecutionFactorySupport indicates connector can accept the MIN aggregate function- Overrides:
supportsAggregatesMinin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsAggregatesSum
public boolean supportsAggregatesSum()
Description copied from class:ExecutionFactorySupport indicates connector can accept the SUM aggregate function- Overrides:
supportsAggregatesSumin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsAggregatesAvg
public boolean supportsAggregatesAvg()
Description copied from class:ExecutionFactorySupport indicates connector can accept the AVG aggregate function- Overrides:
supportsAggregatesAvgin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsGroupBy
@TranslatorProperty(display="Supports Group By", description="Defaults to true. Set to false to have Teiid process group by aggregations, such as those returning more than 2000 rows which error in SOQL", advanced=true) public boolean supportsGroupBy()
Description copied from class:ExecutionFactoryWhether the source supports an explicit GROUP BY clause- Overrides:
supportsGroupByin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsOnlySingleTableGroupBy
public boolean supportsOnlySingleTableGroupBy()
Description copied from class:ExecutionFactoryWhether the source supports grouping only over a single table- Overrides:
supportsOnlySingleTableGroupByin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Returns:
-
supportsNotCriteria
public boolean supportsNotCriteria()
Description copied from class:ExecutionFactorySupport indicates connector accepts logical criteria NOT- Overrides:
supportsNotCriteriain classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsOrCriteria
public boolean supportsOrCriteria()
Description copied from class:ExecutionFactorySupport indicates connector accepts logical criteria connected by OR- Overrides:
supportsOrCriteriain classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsCompareCriteriaOrdered
public boolean supportsCompareCriteriaOrdered()
Description copied from class:ExecutionFactorySupport indicates connector accepts criteria of form (element <=|>= constant)
The query engine will may pushdown queries containing < or > if NOT is also supported.- Overrides:
supportsCompareCriteriaOrderedin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsIsNullCriteria
public boolean supportsIsNullCriteria()
Description copied from class:ExecutionFactorySupport indicates connector accepts criteria of form (element IS NULL)- Overrides:
supportsIsNullCriteriain classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsOnlyLiteralComparison
public boolean supportsOnlyLiteralComparison()
- Overrides:
supportsOnlyLiteralComparisonin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Returns:
- true if only Literal comparisons (equality, ordered, like, etc.) are supported for non-join conditions.
-
supportsHaving
public boolean supportsHaving()
Description copied from class:ExecutionFactoryWhether the source supports the HAVING clause- Overrides:
supportsHavingin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsOnlyRelationshipStyleJoins
public boolean supportsOnlyRelationshipStyleJoins()
- Overrides:
supportsOnlyRelationshipStyleJoinsin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
getMaxFromGroups
@TranslatorProperty(display="Max From Clause Groups", description="The number of Salesforce tables to join. Defaults to 2. Set to a larger number to pushdown more joins.", advanced=true) public int getMaxFromGroups()
Description copied from class:ExecutionFactoryThe number of groups supported in the from clause. Added for a Sybase limitation.- Overrides:
getMaxFromGroupsin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Returns:
- the number of groups supported in the from clause, or -1 if there is no limit
-
setMaxFromGroups
public void setMaxFromGroups(int maxFromGroups)
-
useAnsiJoin
public boolean useAnsiJoin()
Description copied from class:ExecutionFactoryWhether the source prefers to use ANSI style joins.- Overrides:
useAnsiJoinin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsBulkUpdate
public boolean supportsBulkUpdate()
Description copied from class:ExecutionFactoryWhether the source supports updates with multiple value sets- Overrides:
supportsBulkUpdatein classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
getMaxBulkInsertBatchSize
@TranslatorProperty(display="Max Bulk Insert Batch Size", description="The max size of a bulk insert batch. Default 2048.", advanced=true) public int getMaxBulkInsertBatchSize()
-
setMaxBulkInsertBatchSize
public void setMaxBulkInsertBatchSize(int maxInsertBatchSize)
-
setSupportsGroupBy
public void setSupportsGroupBy(boolean supportsGroupBy)
-
buildQueryResult
public com.sforce.soap.partner.QueryResult buildQueryResult(com.sforce.soap.partner.sobject.SObject[] objects)
-
supportsUpsert
public boolean supportsUpsert()
- Overrides:
supportsUpsertin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Returns:
- true if the source supports upsert
-
supportsSelfJoins
public boolean supportsSelfJoins()
Description copied from class:ExecutionFactorySupport indicates connector can accept self-joins where a group is joined to itself with aliases. Connector must also supportExecutionFactory.supportsAliasedTable().- Overrides:
supportsSelfJoinsin classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
supportsAliasedTable
public boolean supportsAliasedTable()
Description copied from class:ExecutionFactorySupport indicates connector can accept groups with aliases- Overrides:
supportsAliasedTablein classExecutionFactory<ConnectionFactory,SalesforceConnection>
-
useBulk
@TranslatorProperty(display="Use Bulk By Default", description="Defaults to false. Set to true to use bulk operations when possible without requiring a bulk source hint.", advanced=true) public boolean useBulk()
-
useHardDelete
@TranslatorProperty(display="Use Hard Delete", description="Defaults to false. Set to true to use hardDelete by default with a bulk delete.", advanced=true) public boolean useHardDelete()
-
setUseBulk
public void setUseBulk(boolean bulk)
-
setUseHardDelete
public void setUseHardDelete(boolean hardDelete)
-
supportsOrderByNullOrdering
public boolean supportsOrderByNullOrdering()
Description copied from class:ExecutionFactoryReturns whether the database supports explicit null ordering.- Overrides:
supportsOrderByNullOrderingin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Returns:
- true if nulls first/last can be specified
-
getDefaultNullOrder
public ExecutionFactory.NullOrder getDefaultNullOrder()
Description copied from class:ExecutionFactoryReturns the default null ordering- Overrides:
getDefaultNullOrderin classExecutionFactory<ConnectionFactory,SalesforceConnection>- Returns:
- the
ExecutionFactory.NullOrder
-
-