Package org.teiid.translator.jdbc.sybase
Class SybaseExecutionFactory
- java.lang.Object
-
- org.teiid.translator.ExecutionFactory<DataSource,Connection>
-
- org.teiid.translator.jdbc.JDBCExecutionFactory
-
- org.teiid.translator.jdbc.sybase.BaseSybaseExecutionFactory
-
- org.teiid.translator.jdbc.sybase.SybaseExecutionFactory
-
- Direct Known Subclasses:
SQLServerExecutionFactory
@Translator(name="sybase", description="A translator for Sybase Database") public class SybaseExecutionFactory extends BaseSybaseExecutionFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SybaseExecutionFactory.SybaseFormatFunctionModifier
-
Nested classes/interfaces inherited from class org.teiid.translator.jdbc.JDBCExecutionFactory
JDBCExecutionFactory.StructRetrieval
-
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 protected ConvertModifier
convertModifier
static Version
FIFTEEN_0_2
static Version
FIFTEEN_5
protected Map<String,Object>
formatMap
protected boolean
jtdsDriver
static Version
TWELVE_5
static Version
TWELVE_5_3
-
Fields inherited from class org.teiid.translator.jdbc.JDBCExecutionFactory
DEFAULT_MAX_DEPENDENT_PREDICATES, DEFAULT_MAX_IN_CRITERIA, DEFAULT_TIME_ZONE, dialect
-
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 SybaseExecutionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
booleanNullable()
protected List<Object>
convertDateToString(Function function)
protected List<?>
convertTimestampToString(Function function)
String
getHibernateDialectClassName()
int
getMaxFromGroups()
The number of groups supported in the from clause.List<String>
getSupportedFunctions()
Get list of all supported function names.void
initCapabilities(Connection connection)
Will be called byExecutionFactory.start()
with a null connection if a source connection is notExecutionFactory.isSourceRequiredForCapabilities()
boolean
isJtdsDriver()
boolean
nullPlusNonNullIsNull()
protected void
populateDateFormats()
protected boolean
setFetchSize()
void
setFetchSize(Command command, ExecutionContext context, Statement statement, int fetchSize)
Set the fetch size on the given statement.void
setJtdsDriver(boolean jtdsDriver)
void
start()
Initialize the connector with supplied configurationboolean
supportsAggregatesEnhancedNumeric()
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMPboolean
supportsFormatLiteral(String literal, ExecutionFactory.Format format)
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
supportsGroupByRollup()
boolean
supportsInlineViews()
Support indicates connector can accept inline views (subqueries in the FROM clause).boolean
supportsLiteralOnlyWithGrouping()
boolean
supportsOnlyFormatLiterals()
boolean
supportsRowLimit()
Gets whether the connector can limit the number of rows returned by a query.boolean
supportsSelectWithoutFrom()
List<?>
translateCommand(Command command, ExecutionContext context)
SetQueries don't have a concept of TOP, an inline view is needed.String
translateLiteralBinaryType(BinaryType obj)
Subclasses should override this method to provide a different sql translation of the literal varbinary value.String
translateLiteralDate(Date dateValue)
Subclasses should override this method to provide a different sql translation of the literal date value.String
translateLiteralTimestamp(Timestamp timestampValue)
Subclasses should override this method to provide a different sql translation of the literal timestamp value.protected boolean
usesDatabaseVersion()
boolean
useUnicodePrefix()
-
Methods inherited from class org.teiid.translator.jdbc.sybase.BaseSybaseExecutionFactory
bindValue, getTemporaryTableName, getTimestampNanoPrecision, hasTimeType, retrieveValue, retrieveValue, supportsAggregatesCountBig, supportsBooleanExpressions, supportsCrossJoin, translate, translateLimit, useAsInGroupAlias, useSelectLimit
-
Methods inherited from class org.teiid.translator.jdbc.JDBCExecutionFactory
addSourceComment, afterInitialConnectionObtained, closeConnection, convertObject, createDirectExecution, createMetadataProcessor, createProcedureExecution, createResultSetExecution, createTempTable, createUpdateExecution, executeStoredProcedure, formatDateValue, formatDateValue, getCommentFormat, getConnection, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCreateTempTableSQL, getDatabaseCalendar, getDatabaseTimeZone, getDatabaseVersion, getDefaultNullOrder, getDefaultSupportedFunctions, getDialect, getFunctionModifiers, getLateralKeyword, getLikeRegexString, getMaxPreparedInsertBatchSize, getMetadata, getMetadataProcessor, getRemovePushdownCharacters, getSetOperationString, getSourceComment, getSQLConversionVisitor, getStructRetrieval, getVersion, intializeConnectionAfterCancel, isCharacterType, isDefaultTimeZone, isEnableDependentJoins, isExtendedAscii, isNonAscii, isNonAscii, isNonAsciiFunction, isSourceRequired, isSourceRequiredForCapabilities, isTrimStrings, loadedTemporaryTable, obtainedConnection, registerFunctionModifier, registerSpecificTypeOfOutParameter, replaceElementName, retrieveGeographyValue, retrieveGeographyValue, retrieveGeometryValue, retrieveGeometryValue, setCommentFormat, setDatabaseTimeZone, setDatabaseVersion, setDatabaseVersion, setEnableDependentJoins, setMaxPreparedInsertBatchSize, setRemovePushdownCharacters, setStructRetrieval, setTrimStrings, setUseBindingsForDependentJoin, setUseBindVariables, setUseCommentsInSourceQuery, supportsAggregatesAvg, supportsAggregatesCount, supportsAggregatesCountStar, supportsAggregatesDistinct, supportsAggregatesMax, supportsAggregatesMin, supportsAggregatesSum, supportsAliasedTable, supportsBatchedUpdates, supportsBulkUpdate, supportsCompareCriteriaEquals, supportsCompareCriteriaOrdered, supportsCorrelatedSubqueries, supportsDependentJoins, supportsExistsCriteria, supportsFullDependentJoins, supportsGeneratedKeys, supportsGeneratedKeys, supportsGroupBy, supportsHaving, supportsInCriteria, supportsInCriteriaSubquery, supportsInsertWithQueryExpression, supportsIsNullCriteria, supportsLikeCriteria, supportsLikeCriteriaEscapeCharacter, supportsNotCriteria, supportsOrCriteria, supportsOrderByUnrelated, supportsProcedureParameterExpression, supportsQuantifiedCompareCriteriaAll, supportsQuantifiedCompareCriteriaSome, supportsScalarSubqueries, supportsSearchedCaseExpressions, supportsSelectExpression, supportsSelfJoins, supportsSetQueryOrderBy, supportsUnions, tempTableRequiresTransaction, translateGeographyLiteral, translateGeographyParameter, translateGeographySelect, translateGeometryLiteral, translateGeometryParameter, translateGeometrySelect, translateLiteralBoolean, translateLiteralTime, useBindingsForDependentJoin, useBindVariables, useColumnNamesForGeneratedKeys, useCommentsInSourceQuery, useNBindingType, useParensForJoins, useParensForSetQueries, usePreparedStatements, useScientificNotation, useStreamsForLobs, useWithRollup
-
Methods inherited from class org.teiid.translator.ExecutionFactory
addPushDownFunction, areLobsUsableAfterClose, createExecution, getCacheDirective, getCollationLocale, getConnection, getDirectQueryProcedureName, getExcludedCommonTableExpressionName, getInstance, getLanguageFactory, getMaxDependentInPredicates, getMaxInCriteriaSize, getMaxProjectedColumns, getNativeQueryProcedureName, getPushDownFunctions, getRequiredLikeEscape, getSupportedJoinCriteria, getTransactionSupport, getTypeFacility, isCopyLobs, isForkable, isImmutable, 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, supportsArrayAgg, supportsArrayType, supportsCommonTableExpressions, supportsCompareCriteriaOrderedExclusive, supportsConvert, supportsCorrelatedSubqueryLimit, supportsDirectQueryProcedure, supportsElementaryOlapOperations, supportsExcept, supportsFullOuterJoins, supportsGeographyType, supportsGroupByMultipleDistinctAggregates, supportsInnerJoins, supportsIntersect, supportsIsDistinctCriteria, supportsLateralJoin, supportsLateralJoinCondition, supportsLikeRegex, supportsListAgg, supportsMultipleOpenExecutions, supportsNativeQueries, supportsOnlyCorrelatedSubqueries, supportsOnlyLateralJoinProcedure, supportsOnlyLiteralComparison, supportsOnlySingleTableGroupBy, supportsOnlyTimestampAddLiteral, supportsOrderBy, supportsOrderByNullOrdering, supportsOrderByWithExtendedGrouping, supportsOuterJoins, supportsPartialFiltering, supportsProcedureTable, supportsRecursiveCommonTableExpressions, supportsRowOffset, supportsScalarSubqueryProjection, supportsSelectDistinct, supportsSelectExpressionArrayType, supportsSetQueryLimitOffset, supportsSimilarTo, supportsStringAgg, supportsSubqueryCommonTableExpressions, supportsSubqueryInOn, supportsUpsert, supportsWindowDistinctAggregates, supportsWindowFrameClause, supportsWindowFunctionCumeDist, supportsWindowFunctionNthValue, supportsWindowFunctionNtile, supportsWindowFunctionPercentRank, supportsWindowOrderByWithAggregates, useAnsiJoin
-
-
-
-
Field Detail
-
TWELVE_5_3
public static final Version TWELVE_5_3
-
TWELVE_5
public static final Version TWELVE_5
-
FIFTEEN_0_2
public static final Version FIFTEEN_0_2
-
FIFTEEN_5
public static final Version FIFTEEN_5
-
jtdsDriver
protected boolean jtdsDriver
-
convertModifier
protected ConvertModifier convertModifier
-
-
Method Detail
-
populateDateFormats
protected void populateDateFormats()
-
start
public void start() throws TranslatorException
Description copied from class:ExecutionFactory
Initialize the connector with supplied configuration- Overrides:
start
in classJDBCExecutionFactory
- 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 classJDBCExecutionFactory
- 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.
-
supportsInlineViews
public boolean supportsInlineViews()
Description copied from class:ExecutionFactory
Support indicates connector can accept inline views (subqueries in the FROM clause).- Overrides:
supportsInlineViews
in classJDBCExecutionFactory
-
supportsFunctionsInGroupBy
public boolean supportsFunctionsInGroupBy()
Description copied from class:ExecutionFactory
Support indicates that the connector supports non-column expressions in GROUP BY, such as:
SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)
- Overrides:
supportsFunctionsInGroupBy
in classExecutionFactory<DataSource,Connection>
-
getMaxFromGroups
public int getMaxFromGroups()
Description copied from class:ExecutionFactory
The number of groups supported in the from clause. Added for a Sybase limitation.- Overrides:
getMaxFromGroups
in classExecutionFactory<DataSource,Connection>
- Returns:
- the number of groups supported in the from clause, or -1 if there is no limit
-
supportsAggregatesEnhancedNumeric
public boolean supportsAggregatesEnhancedNumeric()
Description copied from class:ExecutionFactory
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP- Overrides:
supportsAggregatesEnhancedNumeric
in classExecutionFactory<DataSource,Connection>
-
nullPlusNonNullIsNull
public boolean nullPlusNonNullIsNull()
- Overrides:
nullPlusNonNullIsNull
in classBaseSybaseExecutionFactory
-
booleanNullable
public boolean booleanNullable()
- Overrides:
booleanNullable
in classBaseSybaseExecutionFactory
-
translateLiteralTimestamp
public String translateLiteralTimestamp(Timestamp timestampValue)
Description copied from class:JDBCExecutionFactory
Subclasses should override this method to provide a different sql translation of the literal timestamp value. By default, a timestamp literal is represented as:{ts '2002-12-31 23:59:59'}
. SeeJDBCExecutionFactory.getTimestampNanoPrecision()
to control the literal precision.- Overrides:
translateLiteralTimestamp
in classJDBCExecutionFactory
- Parameters:
timestampValue
- Timestamp value, never null- Returns:
- Translated string
-
translateLiteralDate
public String translateLiteralDate(Date dateValue)
Description copied from class:JDBCExecutionFactory
Subclasses should override this method to provide a different sql translation of the literal date value. By default, a date literal is represented as:{d '2002-12-31'}
- Overrides:
translateLiteralDate
in classJDBCExecutionFactory
- Parameters:
dateValue
- Date value, never null- Returns:
- Translated string
-
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<DataSource,Connection>
-
isJtdsDriver
@TranslatorProperty(display="JTDS Driver", description="True if the driver is the JTDS driver", advanced=true) public boolean isJtdsDriver()
-
setJtdsDriver
public void setJtdsDriver(boolean jtdsDriver)
-
setFetchSize
protected boolean setFetchSize()
-
setFetchSize
public void setFetchSize(Command command, ExecutionContext context, Statement statement, int fetchSize) throws SQLException
Description copied from class:JDBCExecutionFactory
Set the fetch size on the given statement.- Overrides:
setFetchSize
in classJDBCExecutionFactory
- Throws:
SQLException
-
initCapabilities
public void initCapabilities(Connection connection) throws TranslatorException
Description copied from class:ExecutionFactory
Will be called byExecutionFactory.start()
with a null connection if a source connection is notExecutionFactory.isSourceRequiredForCapabilities()
- Overrides:
initCapabilities
in classJDBCExecutionFactory
- Throws:
TranslatorException
-
usesDatabaseVersion
protected boolean usesDatabaseVersion()
- Overrides:
usesDatabaseVersion
in classJDBCExecutionFactory
-
supportsSelectWithoutFrom
public boolean supportsSelectWithoutFrom()
- Overrides:
supportsSelectWithoutFrom
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if the translator support SELECT without a FROM clause
-
getHibernateDialectClassName
public String getHibernateDialectClassName()
- Overrides:
getHibernateDialectClassName
in classJDBCExecutionFactory
-
supportsGroupByRollup
public boolean supportsGroupByRollup()
- Overrides:
supportsGroupByRollup
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if the translator support GROUP BY ROLLUP
-
useUnicodePrefix
public boolean useUnicodePrefix()
- Overrides:
useUnicodePrefix
in classJDBCExecutionFactory
- Returns:
- true if the N prefix an N* type binding should be used for strings containing non-ascii characters
-
supportsOnlyFormatLiterals
public boolean supportsOnlyFormatLiterals()
Description copied from class:ExecutionFactory
- Overrides:
supportsOnlyFormatLiterals
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if only literal formats are supports.
-
supportsFormatLiteral
public boolean supportsFormatLiteral(String literal, ExecutionFactory.Format format)
- Overrides:
supportsFormatLiteral
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if the given Java format string is supported
-
translateCommand
public List<?> translateCommand(Command command, ExecutionContext context)
Description copied from class:BaseSybaseExecutionFactory
SetQueries don't have a concept of TOP, an inline view is needed.- Overrides:
translateCommand
in classBaseSybaseExecutionFactory
- Returns:
- a list of translated parts
-
supportsLiteralOnlyWithGrouping
public boolean supportsLiteralOnlyWithGrouping()
-
translateLiteralBinaryType
public String translateLiteralBinaryType(BinaryType obj)
Description copied from class:JDBCExecutionFactory
Subclasses should override this method to provide a different sql translation of the literal varbinary value. By default, a varbinary literal is represented as:X'hex value'
- Overrides:
translateLiteralBinaryType
in classJDBCExecutionFactory
- Parameters:
obj
- value, never null- Returns:
- Translated string
-
-