@Translator(name="sqlserver", description="A translator for Microsoft SQL Server Database") public class SQLServerExecutionFactory extends SybaseExecutionFactory
SybaseExecutionFactory.SybaseFormatFunctionModifierJDBCExecutionFactory.StructRetrievalExecutionFactory.Format, ExecutionFactory.NullOrder, ExecutionFactory.SupportedJoinCriteria, ExecutionFactory.TransactionSupport| Modifier and Type | Field and Description |
|---|---|
static Version |
ELEVEN_0 |
static Version |
NINE_0 |
static Version |
SEVEN_0 |
static Version |
TEN_0 |
static String |
V_2000 |
static String |
V_2005 |
static String |
V_2008 |
static String |
V_2012 |
convertModifier, FIFTEEN_0_2, FIFTEEN_5, formatMap, jtdsDriver, TWELVE_5, TWELVE_5_3DEFAULT_MAX_DEPENDENT_PREDICATES, DEFAULT_MAX_IN_CRITERIA, DEFAULT_TIME_ZONE, dialectDEFAULT_MAX_FROM_GROUPS, DEFAULT_MAX_IN_CRITERIA_SIZE| Constructor and Description |
|---|
SQLServerExecutionFactory() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
booleanNullable() |
protected List<Object> |
convertDateToString(Function function) |
protected List<?> |
convertTimestampToString(Function function) |
protected JDBCMetadataProcessor |
createMetadataProcessor()
Deprecated.
|
String |
getHibernateDialectClassName() |
int |
getMaxFromGroups()
The number of groups supported in the from clause.
|
MetadataProcessor<Connection> |
getMetadataProcessor()
Get a MetadataProcessor for the translator to read the metadata.
|
List<String> |
getSupportedFunctions()
Get list of all supported function names.
|
boolean |
hasTimeType()
Return false to indicate that time support should be emulated
with timestamps.
|
void |
initCapabilities(Connection connection)
Will be called by
ExecutionFactory.start() with a null connection if a source connection is not ExecutionFactory.isSourceRequiredForCapabilities() |
boolean |
nullPlusNonNullIsNull() |
protected void |
populateDateFormats() |
void |
setDatabaseVersion(String version)
Overridden to allow for year based versions
|
protected boolean |
setFetchSize() |
void |
start()
Initialize the connector with supplied configuration
|
boolean |
supportsAggregatesEnhancedNumeric()
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP
|
boolean |
supportsCommonTableExpressions() |
boolean |
supportsConvert(int fromType,
int toType)
Used for fine grained control of convert/cast pushdown.
|
protected boolean |
supportsCrossJoin() |
boolean |
supportsElementaryOlapOperations() |
boolean |
supportsExcept()
Support indicates that the connector supports the EXCEPT of two queries.
|
boolean |
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 |
supportsIntersect()
Support indicates that the connector supports the INTERSECT of two queries.
|
boolean |
supportsLiteralOnlyWithGrouping() |
boolean |
supportsOnlyFormatLiterals()
|
boolean |
supportsRecursiveCommonTableExpressions() |
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 |
supportsSelectWithoutFrom() |
boolean |
supportsSubqueryCommonTableExpressions() |
boolean |
supportsWindowDistinctAggregates() |
boolean |
supportsWindowOrderByWithAggregates() |
List<?> |
translate(LanguageObject obj,
ExecutionContext context)
Return a List of translated parts (
LanguageObjects and Objects), or null
if to rely on the default translation. |
List<?> |
translateCommand(Command command,
ExecutionContext context)
SetQueries don't have a concept of TOP, an inline view is needed.
|
List<?> |
translateLimit(Limit limit,
ExecutionContext context)
Return a List of translated parts (
LanguageObjects and Objects), or null
if to rely on the default translation. |
String |
translateLiteralDate(Date dateValue)
Subclasses should override this method to provide a different sql translation
of the literal date value.
|
String |
translateLiteralTime(Time timeValue)
The SQL Server driver maps the time escape to a timestamp/datetime, so
use a cast of the string literal instead.
|
String |
translateLiteralTimestamp(Timestamp timestampValue)
Subclasses should override this method to provide a different sql translation
of the literal timestamp value.
|
protected boolean |
usesDatabaseVersion() |
boolean |
useSelectLimit()
Returns whether the limit clause is applied to the select clause.
|
boolean |
useStreamsForLobs()
If streams should be used for Blob/Clob sets on
PreparedStatements |
boolean |
useWithRollup() |
isJtdsDriver, setFetchSize, setJtdsDriver, translateLiteralBinaryType, useUnicodePrefixbindValue, getTemporaryTableName, getTimestampNanoPrecision, retrieveValue, retrieveValue, supportsBooleanExpressions, useAsInGroupAliasaddSourceComment, afterInitialConnectionObtained, closeConnection, convertObject, createDirectExecution, createProcedureExecution, createResultSetExecution, createTempTable, createUpdateExecution, executeStoredProcedure, formatDateValue, formatDateValue, getCommentFormat, getConnection, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCreateTempTableSQL, getDatabaseCalendar, getDatabaseTimeZone, getDatabaseVersion, getDefaultNullOrder, getDefaultSupportedFunctions, getDialect, getFunctionModifiers, getLateralKeyword, getLikeRegexString, getMaxPreparedInsertBatchSize, getMetadata, getSetOperationString, getSourceComment, getSQLConversionVisitor, getStructRetrieval, getVersion, intializeConnectionAfterCancel, isEnableDependentJoins, isSourceRequired, isSourceRequiredForCapabilities, isTrimStrings, loadedTemporaryTable, obtainedConnection, parseName, registerFunctionModifier, registerSpecificTypeOfOutParameter, replaceElementName, retrieveGeometryValue, retrieveGeometryValue, setCommentFormat, setDatabaseTimeZone, setDatabaseVersion, setEnableDependentJoins, setMaxPreparedInsertBatchSize, 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, supportsQuantifiedCompareCriteriaAll, supportsQuantifiedCompareCriteriaSome, supportsScalarSubqueries, supportsSearchedCaseExpressions, supportsSelectExpression, supportsSelfJoins, supportsSetQueryOrderBy, supportsUnions, tempTableRequiresTransaction, translateGeometryLiteral, translateGeometryParameter, translateGeometrySelect, translateLiteralBoolean, useBindingsForDependentJoin, useBindVariables, useColumnNamesForGeneratedKeys, useCommentsInSourceQuery, useParensForJoins, useParensForSetQueries, usePreparedStatements, useScientificNotationaddPushDownFunction, areLobsUsableAfterClose, createExecution, getCacheDirective, getCollationLocale, getConnection, getDirectQueryProcedureName, getExcludedCommonTableExpressionName, getInstance, getLanguageFactory, getMaxDependentInPredicates, getMaxInCriteriaSize, 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, supportsCompareCriteriaOrderedExclusive, supportsCorrelatedSubqueryLimit, supportsDirectQueryProcedure, supportsFullOuterJoins, supportsGroupByMultipleDistinctAggregates, supportsInnerJoins, supportsIsDistinctCriteria, supportsLateralJoin, supportsLateralJoinCondition, supportsLikeRegex, supportsNativeQueries, supportsOnlyCorrelatedSubqueries, supportsOnlyLiteralComparison, supportsOnlySingleTableGroupBy, supportsOrderBy, supportsOrderByNullOrdering, supportsOrderByWithExtendedGrouping, supportsOuterJoins, supportsPartialFiltering, supportsProcedureTable, supportsScalarSubqueryProjection, supportsSelectDistinct, supportsSelectExpressionArrayType, supportsSetQueryLimitOffset, supportsSimilarTo, supportsStringAgg, supportsSubqueryInOn, supportsUpsert, useAnsiJoinpublic static final String V_2000
public static final String V_2005
public static final String V_2008
public static final String V_2012
public static final Version SEVEN_0
public static final Version NINE_0
public static final Version TEN_0
public static final Version ELEVEN_0
public void start()
throws TranslatorException
ExecutionFactorystart in class SybaseExecutionFactoryTranslatorExceptionpublic void initCapabilities(Connection connection) throws TranslatorException
ExecutionFactoryExecutionFactory.start() with a null connection if a source connection is not ExecutionFactory.isSourceRequiredForCapabilities()initCapabilities in class SybaseExecutionFactoryTranslatorExceptionprotected void populateDateFormats()
populateDateFormats in class SybaseExecutionFactoryprotected List<Object> convertDateToString(Function function)
convertDateToString in class SybaseExecutionFactoryprotected List<?> convertTimestampToString(Function function)
convertTimestampToString in class SybaseExecutionFactorypublic List<?> translate(LanguageObject obj, ExecutionContext context)
JDBCExecutionFactoryLanguageObjects and Objects), or null
if to rely on the default translation. Override with care.translate in class BaseSybaseExecutionFactorypublic List<String> getSupportedFunctions()
ExecutionFactorygetSupportedFunctions in class SybaseExecutionFactoryfor 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.public boolean supportsInlineViews()
ExecutionFactorysupportsInlineViews in class SybaseExecutionFactorypublic boolean supportsFunctionsInGroupBy()
ExecutionFactorySupport indicates that the connector supports non-column expressions in GROUP BY, such as:
SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)
supportsFunctionsInGroupBy in class SybaseExecutionFactorypublic boolean supportsRowLimit()
ExecutionFactorysupportsRowLimit in class SybaseExecutionFactorypublic boolean supportsRowOffset()
ExecutionFactorysupportsRowOffset in class ExecutionFactory<DataSource,Connection>public boolean supportsIntersect()
ExecutionFactorysupportsIntersect in class ExecutionFactory<DataSource,Connection>public boolean supportsExcept()
ExecutionFactorysupportsExcept in class ExecutionFactory<DataSource,Connection>public int getMaxFromGroups()
ExecutionFactorygetMaxFromGroups in class SybaseExecutionFactorypublic boolean supportsAggregatesEnhancedNumeric()
ExecutionFactorysupportsAggregatesEnhancedNumeric in class SybaseExecutionFactorypublic boolean nullPlusNonNullIsNull()
nullPlusNonNullIsNull in class SybaseExecutionFactorypublic boolean booleanNullable()
booleanNullable in class SybaseExecutionFactorypublic void setDatabaseVersion(String version)
setDatabaseVersion in class JDBCExecutionFactorypublic String translateLiteralDate(Date dateValue)
JDBCExecutionFactory{d '2002-12-31'}translateLiteralDate in class SybaseExecutionFactorydateValue - Date value, never nullpublic boolean hasTimeType()
JDBCExecutionFactoryhasTimeType in class BaseSybaseExecutionFactorypublic String translateLiteralTime(Time timeValue)
translateLiteralTime in class JDBCExecutionFactorytimeValue - Time value, never nullpublic boolean supportsCommonTableExpressions()
supportsCommonTableExpressions in class ExecutionFactory<DataSource,Connection>public boolean supportsSubqueryCommonTableExpressions()
supportsSubqueryCommonTableExpressions in class ExecutionFactory<DataSource,Connection>public boolean supportsRecursiveCommonTableExpressions()
supportsRecursiveCommonTableExpressions in class ExecutionFactory<DataSource,Connection>protected boolean supportsCrossJoin()
supportsCrossJoin in class BaseSybaseExecutionFactorypublic boolean supportsElementaryOlapOperations()
supportsElementaryOlapOperations in class ExecutionFactory<DataSource,Connection>public boolean supportsWindowDistinctAggregates()
supportsWindowDistinctAggregates in class ExecutionFactory<DataSource,Connection>public boolean supportsWindowOrderByWithAggregates()
supportsWindowOrderByWithAggregates in class ExecutionFactory<DataSource,Connection>public boolean supportsFormatLiteral(String literal, ExecutionFactory.Format format)
supportsFormatLiteral in class SybaseExecutionFactorypublic boolean supportsOnlyFormatLiterals()
ExecutionFactorysupportsOnlyFormatLiterals in class SybaseExecutionFactoryprotected boolean setFetchSize()
setFetchSize in class SybaseExecutionFactory@Deprecated protected JDBCMetadataProcessor createMetadataProcessor()
createMetadataProcessor in class JDBCExecutionFactorygetMetadataProcessorpublic MetadataProcessor<Connection> getMetadataProcessor()
ExecutionFactorygetMetadataProcessor in class JDBCExecutionFactoryprotected boolean usesDatabaseVersion()
usesDatabaseVersion in class SybaseExecutionFactorypublic boolean useStreamsForLobs()
JDBCExecutionFactoryPreparedStatementsuseStreamsForLobs in class JDBCExecutionFactorypublic boolean supportsSelectWithoutFrom()
supportsSelectWithoutFrom in class SybaseExecutionFactorypublic String getHibernateDialectClassName()
getHibernateDialectClassName in class SybaseExecutionFactorypublic boolean supportsGroupByRollup()
supportsGroupByRollup in class SybaseExecutionFactorypublic boolean useWithRollup()
useWithRollup in class JDBCExecutionFactorypublic boolean supportsConvert(int fromType,
int toType)
ExecutionFactoryExecutionFactory.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.supportsConvert in class ExecutionFactory<DataSource,Connection>fromType - @see RUNTIME_CODEStoType - @see RUNTIME_CODESpublic boolean supportsLiteralOnlyWithGrouping()
supportsLiteralOnlyWithGrouping in class SybaseExecutionFactorypublic List<?> translateCommand(Command command, ExecutionContext context)
BaseSybaseExecutionFactorytranslateCommand in class SybaseExecutionFactorypublic List<?> translateLimit(Limit limit, ExecutionContext context)
JDBCExecutionFactoryLanguageObjects and Objects), or null
if to rely on the default translation.translateLimit in class BaseSybaseExecutionFactorypublic boolean useSelectLimit()
JDBCExecutionFactoryuseSelectLimit in class BaseSybaseExecutionFactorypublic String translateLiteralTimestamp(Timestamp timestampValue)
JDBCExecutionFactory{ts '2002-12-31 23:59:59'}.
See JDBCExecutionFactory.getTimestampNanoPrecision() to control the literal
precision.translateLiteralTimestamp in class SybaseExecutionFactorytimestampValue - Timestamp value, never nullCopyright © 2018 JBoss by Red Hat. All rights reserved.