org.teiid.translator.jdbc.mysql
Class MySQLExecutionFactory

java.lang.Object
  extended by org.teiid.translator.ExecutionFactory<DataSource,Connection>
      extended by org.teiid.translator.jdbc.JDBCExecutionFactory
          extended by org.teiid.translator.jdbc.mysql.MySQLExecutionFactory
Direct Known Subclasses:
MySQL5ExecutionFactory

@Translator(name="mysql",
            description="A translator for open source MySQL Database, used with any version lower than 5")
public class MySQLExecutionFactory
extends JDBCExecutionFactory

Since:
4.3

Nested Class Summary
 
Nested classes/interfaces inherited from class org.teiid.translator.ExecutionFactory
ExecutionFactory.NullOrder, ExecutionFactory.SupportedJoinCriteria
 
Field Summary
 
Fields inherited from class org.teiid.translator.jdbc.JDBCExecutionFactory
DEFAULT_MAX_DEPENDENT_PREDICATES, DEFAULT_MAX_IN_CRITERIA, DEFAULT_TIME_ZONE
 
Fields inherited from class org.teiid.translator.ExecutionFactory
DEFAULT_MAX_FROM_GROUPS, DEFAULT_MAX_IN_CRITERIA_SIZE
 
Constructor Summary
MySQLExecutionFactory()
           
 
Method Summary
 List<String> getSupportedFunctions()
          Get list of all supported function names.
 int getTimestampNanoPrecision()
          Return the precision of timestamp literals.
 void start()
          Initialize the connector with supplied configuration
 boolean supportsAggregatesDistinct()
          Support indicates connector can accept DISTINCT within aggregate functions
 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
 String translateLiteralDate(Date dateValue)
          Subclasses should override this method to provide a different sql translation of the literal date value.
 String translateLiteralTime(Time timeValue)
          Subclasses should override this method to provide a different sql translation of the literal time value.
 String translateLiteralTimestamp(Timestamp timestampValue)
          Subclasses should override this method to provide a different sql translation of the literal timestamp value.
 boolean useParensForJoins()
          Set to true to indicate that every branch of a join should have parenthesis.
 boolean useParensForSetQueries()
          Set to true to indicate that every branch of a set query should have parenthesis, i.e.
 
Methods inherited from class org.teiid.translator.jdbc.JDBCExecutionFactory
addSourceComment, afterInitialConnectionObtained, bindValue, closeConnection, createMetadataProcessor, createProcedureExecution, createResultSetExecution, createUpdateExecution, executeStoredProcedure, formatDateValue, getConnection, getDatabaseCalendar, getDatabaseTimeZone, getDatabaseVersion, getDefaultNullOrder, getDefaultSupportedFunctions, getFunctionModifiers, getLikeRegexString, getMaxPreparedInsertBatchSize, getMetadata, getSetOperationString, getSourceComment, getSQLConversionVisitor, hasTimeType, isSourceRequired, isTrimStrings, obtainedConnection, parseName, registerFunctionModifier, registerSpecificTypeOfOutParameter, replaceElementName, retrieveValue, retrieveValue, setDatabaseTimeZone, setDatabaseVersion, setMaxPreparedInsertBatchSize, setTrimStrings, setUseBindVariables, setUseCommentsInSourceQuery, supportsAggregatesAvg, supportsAggregatesCount, supportsAggregatesCountStar, supportsAggregatesMax, supportsAggregatesMin, supportsAggregatesSum, supportsAliasedTable, supportsBatchedUpdates, supportsBetweenCriteria, supportsBulkUpdate, supportsCaseExpressions, supportsCompareCriteriaEquals, supportsCompareCriteriaOrdered, supportsCorrelatedSubqueries, supportsExistsCriteria, supportsGroupBy, supportsHaving, supportsInCriteria, supportsInCriteriaSubquery, supportsInlineViews, supportsInsertWithIterator, supportsInsertWithQueryExpression, supportsIsNullCriteria, supportsLikeCriteria, supportsLikeCriteriaEscapeCharacter, supportsNotCriteria, supportsOrCriteria, supportsOrderByUnrelated, supportsQuantifiedCompareCriteriaAll, supportsQuantifiedCompareCriteriaSome, supportsScalarSubqueries, supportsSearchedCaseExpressions, supportsSelectExpression, supportsSelfJoins, supportsSetQueryOrderBy, supportsUnions, translate, translateCommand, translateLimit, translateLiteralBoolean, useAsInGroupAlias, useBindVariables, useCommentsInSourceQuery, usePreparedStatements, useSelectLimit
 
Methods inherited from class org.teiid.translator.ExecutionFactory
addPushDownFunction, areLobsUsableAfterClose, createExecution, getConnection, getInstance, getLanguageFactory, getMaxDependentInPredicates, getMaxFromGroups, getMaxInCriteriaSize, getPushDownFunctions, getSupportedJoinCriteria, getTypeFacility, isImmutable, requiresCriteria, setImmutable, setMaxDependentInPredicates, setMaxInCriteriaSize, setRequiresCriteria, setSourceRequired, setSupportedJoinCriteria, setSupportsFullOuterJoins, setSupportsInnerJoins, setSupportsOrderBy, setSupportsOuterJoins, setSupportsSelectDistinct, supportsAdvancedOlapOperations, supportsAggregatesEnhancedNumeric, supportsArrayAgg, supportsCommonTableExpressions, supportsElementaryOlapOperations, supportsExcept, supportsFullOuterJoins, supportsFunctionsInGroupBy, supportsInnerJoins, supportsIntersect, supportsLikeRegex, supportsOnlySingleTableGroupBy, supportsOrderBy, supportsOrderByNullOrdering, supportsOuterJoins, supportsSelectDistinct, supportsSimilarTo, supportsWindowDistinctAggregates, supportsWindowOrderByWithAggregates, useAnsiJoin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLExecutionFactory

public MySQLExecutionFactory()
Method Detail

start

public void start()
           throws TranslatorException
Description copied from class: ExecutionFactory
Initialize the connector with supplied configuration

Overrides:
start in class JDBCExecutionFactory
Throws:
TranslatorException

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 class JDBCExecutionFactory
Parameters:
dateValue - Date value, never null
Returns:
Translated string

translateLiteralTime

public String translateLiteralTime(Time timeValue)
Description copied from class: JDBCExecutionFactory
Subclasses should override this method to provide a different sql translation of the literal time value. By default, a time literal is represented as: {t '23:59:59'} See JDBCExecutionFactory.hasTimeType() to represent literal times as timestamps.

Overrides:
translateLiteralTime in class JDBCExecutionFactory
Parameters:
timeValue - Time value, never null
Returns:
Translated string

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'}. See JDBCExecutionFactory.getTimestampNanoPrecision() to control the literal precision.

Overrides:
translateLiteralTimestamp in class JDBCExecutionFactory
Parameters:
timestampValue - Timestamp value, never null
Returns:
Translated string

useParensForSetQueries

public boolean useParensForSetQueries()
Description copied from class: JDBCExecutionFactory
Set to true to indicate that every branch of a set query should have parenthesis, i.e. (query) union (query)

Overrides:
useParensForSetQueries in class JDBCExecutionFactory
Returns:
true if parenthesis should be used for each set branch

getTimestampNanoPrecision

public int getTimestampNanoPrecision()
Description copied from class: JDBCExecutionFactory
Return the precision of timestamp literals. Defaults to 9.

Overrides:
getTimestampNanoPrecision in class JDBCExecutionFactory
Returns:
digits of timestamp nano precision.

useParensForJoins

public boolean useParensForJoins()
Description copied from class: JDBCExecutionFactory
Set to true to indicate that every branch of a join should have parenthesis.

Overrides:
useParensForJoins in class JDBCExecutionFactory
Returns:
true if every branch of a join should use parenthesis

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 class JDBCExecutionFactory

supportsAggregatesDistinct

public boolean supportsAggregatesDistinct()
Description copied from class: ExecutionFactory
Support indicates connector can accept DISTINCT within aggregate functions

Overrides:
supportsAggregatesDistinct in class JDBCExecutionFactory

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 class ExecutionFactory<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 class ExecutionFactory<DataSource,Connection>


Copyright © 2012. All Rights Reserved.