Package org.teiid.translator.jdbc.oracle
Class OracleExecutionFactory
- java.lang.Object
-
- org.teiid.translator.ExecutionFactory<DataSource,Connection>
-
- org.teiid.translator.jdbc.JDBCExecutionFactory
-
- org.teiid.translator.jdbc.oracle.OracleExecutionFactory
-
@Translator(name="oracle", description="A translator for Oracle 9i Database or later") public class OracleExecutionFactory extends JDBCExecutionFactory
-
-
Nested Class Summary
-
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 Map<Class<?>,Integer>
customTypeCodes
static String
DUAL
static Version
ELEVEN_2
static Version
ELEVEN_2_0_4
static String
FILTER
static String
HINT_PREFIX
static String
HINT_SUFFIX
static String
NEAREST_NEIGHBOR
static String
NEAREST_NEIGHBOR_DISTANCE
static Version
NINE_0
static Version
NINE_2
static String
ORACLE
static String
ORACLE_SDO
static String
RELATE
static String
ROWNUM
static String
SEQUENCE
static Version
TWELVE
static String
WITHIN_DISTANCE
-
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 OracleExecutionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
bindValue(PreparedStatement stmt, Object param, Class<?> paramType, int i)
Sets prepared statement parameter i with param.protected JDBCMetadataProcessor
createMetadataProcessor()
Deprecated.String
createTempTable(String string, List<ColumnReference> cols, ExecutionContext context, Connection connection)
Create a temp table with the given name prefix and columnsResultSet
executeStoredProcedure(CallableStatement statement, List<Argument> preparedValues, Class<?> returnType)
This is a generic implementation.String
getCreateTemporaryTablePostfix(boolean inTransaction)
String
getCreateTemporaryTableString(boolean inTransaction)
ExecutionFactory.NullOrder
getDefaultNullOrder()
Returns the default null orderingString
getHibernateDialectClassName()
MetadataProcessor<Connection>
getMetadataProcessor()
Get a MetadataProcessor for the translator to read the metadata.String
getSetOperationString(SetQuery.Operation operation)
Returns the name for a givenSetQuery.Operation
String
getSourceComment(ExecutionContext context, Command command)
Returns the source comment for the given commandSQLConversionVisitor
getSQLConversionVisitor()
Create theSQLConversionVisitor
that will perform translation.List<String>
getSupportedFunctions()
Get list of all supported function names.String
getTemporaryTableName(String prefix)
uses a random table name strategy with a retry in thecreateTempTable(String, List, ExecutionContext, Connection)
methodvoid
handleInsertSequences(Insert insert)
boolean
hasTimeType()
Return false to indicate that time support should be emulated with timestamps.void
initCapabilities(Connection connection)
Will be called byExecutionFactory.start()
with a null connection if a source connection is notExecutionFactory.isSourceRequiredForCapabilities()
void
intializeConnectionAfterCancel(Connection c)
Implemented if theConnection
needs initialized after a statement cancelboolean
isExtendedAscii()
protected boolean
isNonAsciiFunction(Function f)
boolean
isOracleSuppliedDriver()
protected void
registerSpecificTypeOfOutParameter(CallableStatement statement, Class<?> runtimeType, int index)
For registering specific output parameter types we need to translate these into the appropriate java.sql.Types output parameters We will need to match these up with the appropriate standard sql typesString
replaceElementName(String group, String element)
Don't fully qualify elements if table = DUAL or element = ROWNUM or special stuff is packed into name in source value.Object
retrieveGeometryValue(ResultSet results, int paramIndex)
The default strategy assumes a blob value containing wkbvoid
setOracleSuppliedDriver(boolean oracleNative)
void
start()
Initialize the connector with supplied configurationboolean
supportsAggregatesEnhancedNumeric()
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMPboolean
supportsArrayType()
The engine uses array types for dependent joins and for array expression.protected boolean
supportsBooleanExpressions()
if boolean expressions are directly supported.boolean
supportsCommonTableExpressions()
boolean
supportsConvert(int fromType, int toType)
Used for fine grained control of convert/cast pushdown.boolean
supportsCorrelatedSubqueryLimit()
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)
protected boolean
supportsGeneratedKeys(ExecutionContext context, Command command)
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
supportsLikeRegex()
boolean
supportsOnlyFormatLiterals()
boolean
supportsOnlyTimestampAddLiteral()
boolean
supportsOrderByNullOrdering()
Returns whether the database supports explicit null ordering.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 queryboolean
supportsSelectExpressionArrayType()
boolean
supportsSelectWithoutFrom()
boolean
supportsSubqueryInOn()
Refines subquery support.boolean
supportsWindowFunctionNthValue()
List<?>
translate(LanguageObject obj, ExecutionContext context)
Return a List of translated parts (LanguageObject
s and Objects), or null if to rely on the default translation.List<?>
translateCommand(Command command, ExecutionContext context)
Return a List of translated parts (LanguageObject
s and Objects), or null if to rely on the default translation.Expression
translateGeometrySelect(Expression expr)
Translate GEOMETRY column reference into an expression that will return WKB and possibly the SRID.String
translateLiteralBinaryType(BinaryType obj)
Subclasses should override this method to provide a different sql translation of the literal varbinary value.String
translateLiteralTimestamp(Timestamp timestampValue)
Subclasses should override this method to provide a different sql translation of the literal timestamp value.boolean
useAsInGroupAlias()
Indicates whether group alias should be of the form "...FROM groupA AS X" or "...FROM groupA X".boolean
useColumnNamesForGeneratedKeys()
boolean
useNBindingType()
protected boolean
usesDatabaseVersion()
boolean
useStreamsForLobs()
If streams should be used for Blob/Clob sets onPreparedStatement
sboolean
useUnicodePrefix()
-
Methods inherited from class org.teiid.translator.jdbc.JDBCExecutionFactory
addSourceComment, afterInitialConnectionObtained, closeConnection, convertObject, createDirectExecution, createProcedureExecution, createResultSetExecution, createUpdateExecution, formatDateValue, formatDateValue, getCommentFormat, getConnection, getCreateTempTableSQL, getDatabaseCalendar, getDatabaseTimeZone, getDatabaseVersion, getDefaultSupportedFunctions, getDialect, getFunctionModifiers, getLateralKeyword, getLikeRegexString, getMaxPreparedInsertBatchSize, getMetadata, getRemovePushdownCharacters, getStructRetrieval, getTimestampNanoPrecision, getVersion, isCharacterType, isDefaultTimeZone, isEnableDependentJoins, isNonAscii, isNonAscii, isSourceRequired, isSourceRequiredForCapabilities, isTrimStrings, loadedTemporaryTable, obtainedConnection, preserveNullTyping, registerFunctionModifier, retrieveGeographyValue, retrieveGeographyValue, retrieveGeometryValue, retrieveValue, retrieveValue, setCommentFormat, setDatabaseTimeZone, setDatabaseVersion, setDatabaseVersion, setEnableDependentJoins, setFetchSize, setMaxPreparedInsertBatchSize, setRemovePushdownCharacters, setStructRetrieval, setTrimStrings, setUseBindingsForDependentJoin, setUseBindVariables, setUseCommentsInSourceQuery, supportsAggregatesAvg, supportsAggregatesCount, supportsAggregatesCountStar, supportsAggregatesDistinct, supportsAggregatesMax, supportsAggregatesMin, supportsAggregatesSum, supportsAliasedTable, supportsBatchedUpdates, supportsBulkUpdate, supportsCompareCriteriaEquals, supportsCompareCriteriaOrdered, supportsCorrelatedSubqueries, supportsDependentJoins, supportsExistsCriteria, supportsFullDependentJoins, 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, translateLimit, translateLiteralBoolean, translateLiteralDate, translateLiteralTime, useBindingsForDependentJoin, useBindVariables, useCommentsInSourceQuery, useParensForJoins, useParensForSetQueries, usePreparedStatements, useScientificNotation, useSelectLimit, useWithRollup
-
Methods inherited from class org.teiid.translator.ExecutionFactory
addPushDownFunction, areLobsUsableAfterClose, createExecution, getCacheDirective, getCollationLocale, getConnection, getDirectQueryProcedureName, getExcludedCommonTableExpressionName, getInstance, getLanguageFactory, getMaxDependentInPredicates, getMaxFromGroups, 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, supportsAggregatesCountBig, supportsArrayAgg, supportsCompareCriteriaOrderedExclusive, supportsDirectQueryProcedure, supportsFullOuterJoins, supportsGeographyType, supportsGroupByMultipleDistinctAggregates, supportsInnerJoins, supportsIsDistinctCriteria, supportsLateralJoin, supportsLateralJoinCondition, supportsListAgg, supportsMultipleOpenExecutions, supportsNativeQueries, supportsOnlyCorrelatedSubqueries, supportsOnlyLateralJoinProcedure, supportsOnlyLiteralComparison, supportsOnlyRelationshipStyleJoins, supportsOnlySingleTableGroupBy, supportsOrderBy, supportsOrderByWithExtendedGrouping, supportsOuterJoins, supportsPartialFiltering, supportsProcedureTable, supportsScalarSubqueryProjection, supportsSelectDistinct, supportsSetQueryLimitOffset, supportsSimilarTo, supportsStringAgg, supportsSubqueryCommonTableExpressions, supportsUpsert, supportsWindowDistinctAggregates, supportsWindowFrameClause, supportsWindowFunctionCumeDist, supportsWindowFunctionNtile, supportsWindowFunctionPercentRank, supportsWindowOrderByWithAggregates, useAnsiJoin
-
-
-
-
Field Detail
-
NINE_0
public static final Version NINE_0
-
NINE_2
public static final Version NINE_2
-
ELEVEN_2_0_4
public static final Version ELEVEN_2_0_4
-
ELEVEN_2
public static final Version ELEVEN_2
-
TWELVE
public static final Version TWELVE
-
HINT_PREFIX
public static final String HINT_PREFIX
- See Also:
- Constant Field Values
-
HINT_SUFFIX
public static final String HINT_SUFFIX
- See Also:
- Constant Field Values
-
DUAL
public static final String DUAL
- See Also:
- Constant Field Values
-
ROWNUM
public static final String ROWNUM
- See Also:
- Constant Field Values
-
SEQUENCE
public static final String SEQUENCE
- See Also:
- Constant Field Values
-
RELATE
public static final String RELATE
- See Also:
- Constant Field Values
-
NEAREST_NEIGHBOR
public static final String NEAREST_NEIGHBOR
- See Also:
- Constant Field Values
-
FILTER
public static final String FILTER
- See Also:
- Constant Field Values
-
WITHIN_DISTANCE
public static final String WITHIN_DISTANCE
- See Also:
- Constant Field Values
-
NEAREST_NEIGHBOR_DISTANCE
public static final String NEAREST_NEIGHBOR_DISTANCE
- See Also:
- Constant Field Values
-
ORACLE_SDO
public static final String ORACLE_SDO
- See Also:
- Constant Field Values
-
ORACLE
public static final String ORACLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start() throws TranslatorException
Description copied from class:ExecutionFactory
Initialize the connector with supplied configuration- Overrides:
start
in classJDBCExecutionFactory
- Throws:
TranslatorException
-
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
-
handleInsertSequences
public void handleInsertSequences(Insert insert) throws TranslatorException
- Throws:
TranslatorException
-
translateCommand
public List<?> translateCommand(Command command, ExecutionContext context)
Description copied from class:JDBCExecutionFactory
Return a List of translated parts (LanguageObject
s and Objects), or null if to rely on the default translation.- Overrides:
translateCommand
in classJDBCExecutionFactory
- Returns:
- a list of translated parts
-
useAsInGroupAlias
public boolean useAsInGroupAlias()
Description copied from class:JDBCExecutionFactory
Indicates whether group alias should be of the form "...FROM groupA AS X" or "...FROM groupA X". Certain data sources (such as Oracle) may not support the first form.- Overrides:
useAsInGroupAlias
in classJDBCExecutionFactory
- Returns:
- boolean
-
getSetOperationString
public String getSetOperationString(SetQuery.Operation operation)
Description copied from class:JDBCExecutionFactory
Returns the name for a givenSetQuery.Operation
- Overrides:
getSetOperationString
in classJDBCExecutionFactory
- Returns:
- the name for the set operation
-
getSourceComment
public String getSourceComment(ExecutionContext context, Command command)
Description copied from class:JDBCExecutionFactory
Returns the source comment for the given command- Overrides:
getSourceComment
in classJDBCExecutionFactory
- Returns:
- the comment
-
replaceElementName
public String replaceElementName(String group, String element)
Don't fully qualify elements if table = DUAL or element = ROWNUM or special stuff is packed into name in source value.- Overrides:
replaceElementName
in classJDBCExecutionFactory
- Returns:
- thre replacement name
- Since:
- 5.0
-
hasTimeType
public boolean hasTimeType()
Description copied from class:JDBCExecutionFactory
Return false to indicate that time support should be emulated with timestamps.- Overrides:
hasTimeType
in classJDBCExecutionFactory
- Returns:
- true if database has a time type
-
bindValue
public void bindValue(PreparedStatement stmt, Object param, Class<?> paramType, int i) throws SQLException
Description copied from class:JDBCExecutionFactory
Sets prepared statement parameter i with param. Performs special handling to translate dates using the database time zone and to translate biginteger, float, and char to JDBC safe objects.- Overrides:
bindValue
in classJDBCExecutionFactory
- Throws:
SQLException
-
useStreamsForLobs
public boolean useStreamsForLobs()
Description copied from class:JDBCExecutionFactory
If streams should be used for Blob/Clob sets onPreparedStatement
s- Overrides:
useStreamsForLobs
in classJDBCExecutionFactory
- Returns:
-
getDefaultNullOrder
public ExecutionFactory.NullOrder getDefaultNullOrder()
Description copied from class:ExecutionFactory
Returns the default null ordering- Overrides:
getDefaultNullOrder
in classJDBCExecutionFactory
- Returns:
- the
ExecutionFactory.NullOrder
-
supportsOrderByNullOrdering
public boolean supportsOrderByNullOrdering()
Description copied from class:ExecutionFactory
Returns whether the database supports explicit null ordering.- Overrides:
supportsOrderByNullOrdering
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if nulls first/last can be specified
-
getSQLConversionVisitor
public SQLConversionVisitor getSQLConversionVisitor()
Description copied from class:JDBCExecutionFactory
Create theSQLConversionVisitor
that will perform translation. Typical custom JDBC connectors will not need to create custom conversion visitors, rather implementors should override existingJDBCExecutionFactory
methods.- Overrides:
getSQLConversionVisitor
in classJDBCExecutionFactory
- Returns:
- the
SQLConversionVisitor
-
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.
-
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
-
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>
-
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>
-
supportsRowOffset
public boolean supportsRowOffset()
Description copied from class:ExecutionFactory
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- Overrides:
supportsRowOffset
in classExecutionFactory<DataSource,Connection>
-
supportsExcept
public boolean supportsExcept()
Description copied from class:ExecutionFactory
Support indicates that the connector supports the EXCEPT of two queries.- Overrides:
supportsExcept
in classExecutionFactory<DataSource,Connection>
-
supportsIntersect
public boolean supportsIntersect()
Description copied from class:ExecutionFactory
Support indicates that the connector supports the INTERSECT of two queries.- Overrides:
supportsIntersect
in classExecutionFactory<DataSource,Connection>
-
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>
-
supportsElementaryOlapOperations
public boolean supportsElementaryOlapOperations()
- Overrides:
supportsElementaryOlapOperations
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if Elementary OLAP operations are supported including window functions and inline window specifications that include simple expressions in partitioning and ordering
-
supportsLikeRegex
public boolean supportsLikeRegex()
- Overrides:
supportsLikeRegex
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if the LIKE_REGEX predicate is supported
-
setOracleSuppliedDriver
public void setOracleSuppliedDriver(boolean oracleNative)
-
isOracleSuppliedDriver
@TranslatorProperty(display="Oracle Supplied Driver", description="True if the driver is an Oracle supplied driver", advanced=true) public boolean isOracleSuppliedDriver()
-
registerSpecificTypeOfOutParameter
protected void registerSpecificTypeOfOutParameter(CallableStatement statement, Class<?> runtimeType, int index) throws SQLException
Description copied from class:JDBCExecutionFactory
For registering specific output parameter types we need to translate these into the appropriate java.sql.Types output parameters We will need to match these up with the appropriate standard sql types- Overrides:
registerSpecificTypeOfOutParameter
in classJDBCExecutionFactory
- Throws:
SQLException
-
executeStoredProcedure
public ResultSet executeStoredProcedure(CallableStatement statement, List<Argument> preparedValues, Class<?> returnType) throws SQLException
Description copied from class:JDBCExecutionFactory
This is a generic implementation. Because different databases handle stored procedures differently, subclasses should override this method if necessary.- Overrides:
executeStoredProcedure
in classJDBCExecutionFactory
- Throws:
SQLException
-
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
-
supportsArrayType
public boolean supportsArrayType()
Description copied from class:ExecutionFactory
The engine uses array types for dependent joins and for array expression.- Overrides:
supportsArrayType
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if an array type is supported.
-
createMetadataProcessor
@Deprecated protected JDBCMetadataProcessor createMetadataProcessor()
Deprecated.- Overrides:
createMetadataProcessor
in classJDBCExecutionFactory
- See Also:
JDBCExecutionFactory.getMetadataProcessor()
-
getMetadataProcessor
public MetadataProcessor<Connection> getMetadataProcessor()
Description copied from class:ExecutionFactory
Get a MetadataProcessor for the translator to read the metadata. Typically this will return a new instance.- Overrides:
getMetadataProcessor
in classJDBCExecutionFactory
- Returns:
-
supportsCommonTableExpressions
public boolean supportsCommonTableExpressions()
- Overrides:
supportsCommonTableExpressions
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if the WITH clause is supported
-
supportsRecursiveCommonTableExpressions
public boolean supportsRecursiveCommonTableExpressions()
- Overrides:
supportsRecursiveCommonTableExpressions
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if a recursive WITH clause item is supported
-
supportsGeneratedKeys
protected boolean supportsGeneratedKeys(ExecutionContext context, Command command)
- Overrides:
supportsGeneratedKeys
in classJDBCExecutionFactory
- Returns:
- true if generated keys can be returned
-
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
-
createTempTable
public String createTempTable(String string, List<ColumnReference> cols, ExecutionContext context, Connection connection) throws SQLException
Description copied from class:JDBCExecutionFactory
Create a temp table with the given name prefix and columns- Overrides:
createTempTable
in classJDBCExecutionFactory
- Returns:
- the name of the table created
- Throws:
SQLException
-
getTemporaryTableName
public String getTemporaryTableName(String prefix)
uses a random table name strategy with a retry in thecreateTempTable(String, List, ExecutionContext, Connection)
method- Overrides:
getTemporaryTableName
in classJDBCExecutionFactory
- Returns:
- a valid temporary table name
-
getCreateTemporaryTablePostfix
public String getCreateTemporaryTablePostfix(boolean inTransaction)
- Overrides:
getCreateTemporaryTablePostfix
in classJDBCExecutionFactory
- Returns:
- the post script for the temp table create
-
getCreateTemporaryTableString
public String getCreateTemporaryTableString(boolean inTransaction)
- Overrides:
getCreateTemporaryTableString
in classJDBCExecutionFactory
- Returns:
- the temp table creation ddl
-
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
-
translateGeometrySelect
public Expression translateGeometrySelect(Expression expr)
Description copied from class:JDBCExecutionFactory
Translate GEOMETRY column reference into an expression that will return WKB and possibly the SRID.- Overrides:
translateGeometrySelect
in classJDBCExecutionFactory
- Returns:
-
retrieveGeometryValue
public Object retrieveGeometryValue(ResultSet results, int paramIndex) throws SQLException
Description copied from class:JDBCExecutionFactory
The default strategy assumes a blob value containing wkb- Overrides:
retrieveGeometryValue
in classJDBCExecutionFactory
- Returns:
- Throws:
SQLException
-
intializeConnectionAfterCancel
public void intializeConnectionAfterCancel(Connection c) throws SQLException
Description copied from class:JDBCExecutionFactory
Implemented if theConnection
needs initialized after a statement cancel- Overrides:
intializeConnectionAfterCancel
in classJDBCExecutionFactory
- Throws:
SQLException
-
supportsCorrelatedSubqueryLimit
public boolean supportsCorrelatedSubqueryLimit()
- Overrides:
supportsCorrelatedSubqueryLimit
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if a correlated subquery can support a limit clause
-
useColumnNamesForGeneratedKeys
public boolean useColumnNamesForGeneratedKeys()
- Overrides:
useColumnNamesForGeneratedKeys
in classJDBCExecutionFactory
- Returns:
- true if column names are required to retrieve generated keys
-
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
-
supportsSubqueryInOn
public boolean supportsSubqueryInOn()
Description copied from class:ExecutionFactory
Refines subquery support.- Overrides:
supportsSubqueryInOn
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if subqueries are supported in the on clause.
-
supportsConvert
public boolean supportsConvert(int fromType, int toType)
Description copied from class:ExecutionFactory
Used for fine grained control of convert/cast pushdown. TheExecutionFactory.getSupportedFunctions()
should containSourceSystemFunctions.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.- Overrides:
supportsConvert
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if the given conversion is supported.
- See Also:
TypeFacility.RUNTIME_CODES
,TypeFacility.RUNTIME_CODES
-
supportsBooleanExpressions
protected boolean supportsBooleanExpressions()
Description copied from class:JDBCExecutionFactory
if boolean expressions are directly supported. will generally be false if there is no boolean datatype- Overrides:
supportsBooleanExpressions
in classJDBCExecutionFactory
- Returns:
-
supportsSelectExpressionArrayType
public boolean supportsSelectExpressionArrayType()
- Overrides:
supportsSelectExpressionArrayType
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if array type expressions can be projected
-
translate
public List<?> translate(LanguageObject obj, ExecutionContext context)
Description copied from class:JDBCExecutionFactory
Return a List of translated parts (LanguageObject
s and Objects), or null if to rely on the default translation. Override with care.- Overrides:
translate
in classJDBCExecutionFactory
- Returns:
- list of translated parts
-
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
-
isNonAsciiFunction
protected boolean isNonAsciiFunction(Function f)
- Overrides:
isNonAsciiFunction
in classJDBCExecutionFactory
- Returns:
- true if the function is a conversion function to a non-ascii string type An implementation is not required if no such function exists, or the source can handle unicode string using the standard types.
-
isExtendedAscii
public boolean isExtendedAscii()
- Overrides:
isExtendedAscii
in classJDBCExecutionFactory
- Returns:
- true if the database code page includes extended characters values in the 128-255 range
-
useNBindingType
public boolean useNBindingType()
- Overrides:
useNBindingType
in classJDBCExecutionFactory
- Returns:
- true if an N type (NVARCHAR, NCLOB) should be used when a non-ascii value is encountered
-
supportsOnlyTimestampAddLiteral
public boolean supportsOnlyTimestampAddLiteral()
- Overrides:
supportsOnlyTimestampAddLiteral
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if the source supports only timestamp add literals
-
supportsWindowFunctionNthValue
public boolean supportsWindowFunctionNthValue()
- Overrides:
supportsWindowFunctionNthValue
in classExecutionFactory<DataSource,Connection>
- Returns:
- true if nth_value is supported.
defaults to
ExecutionFactory.supportsElementaryOlapOperations()
-
-