@Translator(name="loopback", description="A translator for testing, that returns mock data") public class LoopbackExecutionFactory extends BaseDelegatingExecutionFactory
ExecutionFactory.Format, ExecutionFactory.NullOrder, ExecutionFactory.SupportedJoinCriteria, ExecutionFactory.TransactionSupport
DEFAULT_MAX_FROM_GROUPS, DEFAULT_MAX_IN_CRITERIA_SIZE
Constructor and Description |
---|
LoopbackExecutionFactory() |
Modifier and Type | Method and Description |
---|---|
Execution |
createExecution(Command command,
ExecutionContext executionContext,
RuntimeMetadata metadata,
Object connection)
Create an execution object for the specified command
|
int |
getCharacterValuesSize() |
Object |
getConnection(Object factory)
Return a connection object from the given connection factory.
|
Object |
getConnection(Object factory,
ExecutionContext executionContext)
Return a connection object from the given connection factory.
|
String |
getDelegateName() |
boolean |
getIncrementRows() |
void |
getMetadata(MetadataFactory metadataFactory,
Object conn)
Implement to provide metadata to the metadata for use by the engine.
|
long |
getPollIntervalInMilli() |
int |
getRowCount() |
int |
getWaitTime() |
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 |
isThrowError() |
boolean |
returnsSingleUpdateCount()
True if the only a single value is returned for the update count.
|
void |
setCharacterValuesSize(int charValSize) |
void |
setIncrementRows(boolean incrementRows) |
void |
setPollIntervalInMilli(long intervel) |
void |
setRowCount(int rowCount) |
void |
setThrowError(boolean error) |
void |
setWaitTime(int waitTime) |
void |
start()
Initialize the connector with supplied configuration
|
areLobsUsableAfterClose, closeConnection, createDirectExecution, createProcedureExecution, createResultSetExecution, createUpdateExecution, equals, getAddSupportedFunctions, getCacheDirective, getCachePattern, getCacheTtl, getCollationLocale, getDefaultNullOrder, getDelegate, getDirectQueryProcedureName, getExcludedCommonTableExpressionName, getLanguageFactory, getMaxDependentInPredicates, getMaxFromGroups, getMaxInCriteriaSize, getPushDownFunctions, getRemoveSupportedFunctions, getRequiredLikeEscape, getSupportedFunctions, getSupportedJoinCriteria, getTransactionSupport, getTypeFacility, hashCode, initCapabilities, isCopyLobs, isForkable, isImmutable, isSourceRequiredForCapabilities, isThreadBound, requiresCriteria, setAddSupportedFunctions, setCachePattern, setCacheTtl, setCollationLocale, setCopyLobs, setDefaultNullOrder, setDelegate, setDelegateName, setDirectQueryProcedureName, setExcludedCommonTableExpressionName, setForkable, setImmutable, setMaxDependentInPredicates, setMaxFromGroups, setMaxInCriteriaSize, setRemoveSupportedFunctions, setRequiredLikeEscape, setRequiresCriteria, setSourceRequired, setSourceRequiredForCapabilities, setSourceRequiredForMetadata, setSupportedJoinCriteria, setSupportsAdvancedOlapOperations, setSupportsAggregatesAvg, setSupportsAggregatesCount, setSupportsAggregatesCountStar, setSupportsAggregatesDistinct, setSupportsAggregatesEnhancedNumeric, setSupportsAggregatesMax, setSupportsAggregatesMin, setSupportsAggregatesSum, setSupportsAliasedTable, setSupportsArrayAgg, setSupportsArrayType, setSupportsBatchedUpdates, setSupportsBulkUpdate, setSupportsCommonTableExpressions, setSupportsCompareCriteriaEquals, setSupportsCompareCriteriaOrdered, setSupportsCompareCriteriaOrderedExclusive, setSupportsCorrelatedSubqueries, setSupportsCorrelatedSubqueryLimit, setSupportsDependentJoins, setSupportsDirectQueryProcedure, setSupportsElementaryOlapOperations, setSupportsExcept, setSupportsExistsCriteria, setSupportsFullDependentJoins, setSupportsFullOuterJoins, setSupportsFunctionsInGroupBy, setSupportsGroupBy, setSupportsGroupByMultipleDistinctAggregates, setSupportsGroupByRollup, setSupportsHaving, setSupportsInCriteria, setSupportsInCriteriaSubquery, setSupportsInlineViews, setSupportsInnerJoins, setSupportsInsertWithQueryExpression, setSupportsIntersect, setSupportsIsDistinctCriteria, setSupportsIsNullCriteria, setSupportsLateralJoin, setSupportsLateralJoinCondition, setSupportsLikeCriteria, setSupportsLikeCriteriaEscapeCharacter, setSupportsLikeRegex, setSupportsNotCriteria, setSupportsOnlyCorrelatedSubqueries, setSupportsOnlyFormatLiterals, setSupportsOnlyLateralJoinProcedure, setSupportsOnlyLiteralComparison, setSupportsOnlySingleTableGroupBy, setSupportsOnlyTimestampAddLiteral, setSupportsOrCriteria, setSupportsOrderBy, setSupportsOrderByNullOrdering, setSupportsOrderByUnrelated, setSupportsOrderByWithExtendedGrouping, setSupportsOuterJoins, setSupportsPartialFiltering, setSupportsProcedureTable, setSupportsQuantifiedCompareCriteriaAll, setSupportsQuantifiedCompareCriteriaSome, setSupportsRecursiveCommonTableExpressions, setSupportsRowLimit, setSupportsRowOffset, setSupportsScalarSubqueries, setSupportsScalarSubqueryProjection, setSupportsSearchedCaseExpressions, setSupportsSelectDistinct, setSupportsSelectExpression, setSupportsSelectExpressionArrayType, setSupportsSelectWithoutFrom, setSupportsSelfJoins, setSupportsSetQueryLimitOffset, setSupportsSetQueryOrderBy, setSupportsSimilarTo, setSupportsStringAgg, setSupportsSubqueryCommonTableExpressions, setSupportsSubqueryInOn, setSupportsUnions, setSupportsUpsert, setSupportsWindowDistinctAggregates, setSupportsWindowFunctionCumeDist, setSupportsWindowFunctionNthValue, setSupportsWindowFunctionNtile, setSupportsWindowFunctionPercentRank, setSupportsWindowOrderByWithAggregates, setThreadBound, setTransactionSupport, setUseAnsiJoin, setUseBindingsForDependentJoin, supportsAdvancedOlapOperations, supportsAggregatesAvg, supportsAggregatesCount, supportsAggregatesCountStar, supportsAggregatesDistinct, supportsAggregatesEnhancedNumeric, supportsAggregatesMax, supportsAggregatesMin, supportsAggregatesSum, supportsAliasedTable, supportsArrayAgg, supportsArrayType, supportsBatchedUpdates, supportsBulkUpdate, supportsCommonTableExpressions, supportsCompareCriteriaEquals, supportsCompareCriteriaOrdered, supportsCompareCriteriaOrderedExclusive, supportsCompareCriteriaOrderedExclusive, supportsConvert, supportsCorrelatedSubqueries, supportsCorrelatedSubqueryLimit, supportsDependentJoins, supportsDirectQueryProcedure, supportsElementaryOlapOperations, supportsExcept, supportsExistsCriteria, supportsFormatLiteral, supportsFullDependentJoins, supportsFullOuterJoins, supportsFunctionsInGroupBy, supportsGroupBy, supportsGroupByMultipleDistinctAggregates, supportsGroupByRollup, supportsHaving, supportsInCriteria, supportsInCriteriaSubquery, supportsInlineViews, supportsInnerJoins, supportsInsertWithQueryExpression, supportsIntersect, supportsIsDistinctCriteria, supportsIsNullCriteria, supportsLateralJoin, supportsLateralJoinCondition, supportsLikeCriteria, supportsLikeCriteriaEscapeCharacter, supportsLikeRegex, supportsNotCriteria, supportsOnlyCorrelatedSubqueries, supportsOnlyFormatLiterals, supportsOnlyLateralJoinProcedure, supportsOnlyLiteralComparison, supportsOnlySingleTableGroupBy, supportsOnlyTimestampAddLiteral, supportsOrCriteria, supportsOrderBy, supportsOrderByNullOrdering, supportsOrderByUnrelated, supportsOrderByWithExtendedGrouping, supportsOuterJoins, supportsPartialFiltering, supportsProcedureTable, supportsQuantifiedCompareCriteriaAll, supportsQuantifiedCompareCriteriaSome, supportsRecursiveCommonTableExpressions, supportsRowLimit, supportsRowOffset, supportsScalarSubqueries, supportsScalarSubqueryProjection, supportsSearchedCaseExpressions, supportsSelectDistinct, supportsSelectExpression, supportsSelectExpressionArrayType, supportsSelectWithoutFrom, supportsSelfJoins, supportsSetQueryLimitOffset, supportsSetQueryOrderBy, supportsSimilarTo, supportsStringAgg, supportsSubqueryCommonTableExpressions, supportsSubqueryInOn, supportsUnions, supportsUpsert, supportsWindowDistinctAggregates, supportsWindowFunctionCumeDist, supportsWindowFunctionNthValue, supportsWindowFunctionNtile, supportsWindowFunctionPercentRank, supportsWindowOrderByWithAggregates, toString, useAnsiJoin, useBindingsForDependentJoin
addPushDownFunction, getInstance, getMetadataProcessor, getNativeQueryProcedureName, setNativeQueryProcedureName, setSupportsNativeQueries, supportsNativeQueries
public void start() throws TranslatorException
ExecutionFactory
start
in class BaseDelegatingExecutionFactory
TranslatorException
@TranslatorProperty(display="Size of values for CLOB, VARCHAR, etc.", advanced=true) public int getCharacterValuesSize()
public void setCharacterValuesSize(int charValSize)
@TranslatorProperty(display="If set to true each value in each column is being incremented with each row", advanced=true) public boolean getIncrementRows()
public void setIncrementRows(boolean incrementRows)
public Object getConnection(Object factory) throws TranslatorException
ExecutionFactory
ConnectionFactory
. Subclasses should override, if they use
another type of connection factory.getConnection
in class ExecutionFactory
TranslatorException
ExecutionFactory.getConnection(Object, ExecutionContext)
public Object getConnection(Object factory, ExecutionContext executionContext) throws TranslatorException
ExecutionFactory
ConnectionFactory
. Subclasses should override, if they use
another type of connection factory or wish to use the ExecutionContext
. By default calls ExecutionFactory.getConnection(Object)
getConnection
in class BaseDelegatingExecutionFactory
executionContext
- null if this is a system request for a connectionTranslatorException
@TranslatorProperty(display="Max Random Wait Time", advanced=true) public int getWaitTime()
public void setWaitTime(int waitTime)
@TranslatorProperty(display="Rows Per Query", advanced=true) public int getRowCount()
public void setRowCount(int rowCount)
@TranslatorProperty(display="Always Throw Error") public boolean isThrowError()
public void setThrowError(boolean error)
@TranslatorProperty(display="Poll interval if using a Asynchronous Connector") public long getPollIntervalInMilli()
public void setPollIntervalInMilli(long intervel)
public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException
ExecutionFactory
createExecution
in class ExecutionFactory
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 sourceTranslatorException
public boolean isSourceRequired()
ExecutionFactory
isSourceRequired
in class BaseDelegatingExecutionFactory
public boolean isSourceRequiredForMetadata()
ExecutionFactory
isSourceRequiredForMetadata
in class BaseDelegatingExecutionFactory
public void getMetadata(MetadataFactory metadataFactory, Object conn) throws TranslatorException
ExecutionFactory
getMetadata
in class BaseDelegatingExecutionFactory
conn
- may be null if the source is not requiredTranslatorException
- to indicate a recoverable error, otherwise a RuntimeExceptionExecutionFactory.isSourceRequiredForMetadata()
@TranslatorProperty(display="Delegate name", required=false) public String getDelegateName()
getDelegateName
in interface DelegatingExecutionFactory
getDelegateName
in class BaseDelegatingExecutionFactory
public boolean returnsSingleUpdateCount()
ExecutionFactory
returnsSingleUpdateCount
in class BaseDelegatingExecutionFactory
Copyright © 2018 JBoss by Red Hat. All rights reserved.