org.teiid.connector.jdbc.mysql
Class MySQLTranslator

java.lang.Object
  extended by org.teiid.connector.jdbc.translator.Translator
      extended by org.teiid.connector.jdbc.mysql.MySQLTranslator
Direct Known Subclasses:
MySQL5Translator

public class MySQLTranslator
extends Translator

Since:
4.3

Field Summary
 
Fields inherited from class org.teiid.connector.jdbc.translator.Translator
DEFAULT_TIME_ZONE
 
Constructor Summary
MySQLTranslator()
           
 
Method Summary
 void afterConnectionCreation(java.sql.Connection connection)
          Provides a hook to call source specific logic when a connection is created.
 java.lang.Class<? extends ConnectorCapabilities> getDefaultCapabilities()
          Get the default capabilities class.
 int getTimestampNanoPrecision()
          Return the precision of timestamp literals.
 void initialize(ConnectorEnvironment env)
          Initialize the SQLTranslator.
 java.lang.String translateLiteralDate(java.sql.Date dateValue)
          Subclasses should override this method to provide a different sql translation of the literal date value.
 java.lang.String translateLiteralTime(java.sql.Time timeValue)
          Subclasses should override this method to provide a different sql translation of the literal time value.
 java.lang.String translateLiteralTimestamp(java.sql.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.connector.jdbc.translator.Translator
addSourceComment, afterInitialConnectionCreation, bindValue, executeStoredProcedure, formatDateValue, getConnectionTestQuery, getConnectorCapabilities, getDatabaseCalendar, getDefaultConnectionTestQuery, getEnvironment, getFunctionModifiers, getIsValidTimeout, getLanguageFactory, getSetOperationString, getSourceComment, getSQLConversionVisitor, getTypeFacility, hasTimeType, modifyCommand, registerFunctionModifier, registerSpecificTypeOfOutParameter, replaceElementName, retrieveValue, retrieveValue, translateCommand, translateLimit, translateLiteralBoolean, useAsInGroupAlias, usePreparedStatements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLTranslator

public MySQLTranslator()
Method Detail

initialize

public void initialize(ConnectorEnvironment env)
                throws ConnectorException
Description copied from class: Translator
Initialize the SQLTranslator.

Overrides:
initialize in class Translator
Throws:
ConnectorException

translateLiteralDate

public java.lang.String translateLiteralDate(java.sql.Date dateValue)
Description copied from class: Translator
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 Translator
Parameters:
dateValue - Date value, never null
Returns:
Translated string

translateLiteralTime

public java.lang.String translateLiteralTime(java.sql.Time timeValue)
Description copied from class: Translator
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 Translator.hasTimeType() to represent literal times as timestamps.

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

translateLiteralTimestamp

public java.lang.String translateLiteralTimestamp(java.sql.Timestamp timestampValue)
Description copied from class: Translator
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 Translator.getTimestampNanoPrecision() to control the literal precision.

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

useParensForSetQueries

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

Overrides:
useParensForSetQueries in class Translator
Returns:

getTimestampNanoPrecision

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

Overrides:
getTimestampNanoPrecision in class Translator
Returns:

afterConnectionCreation

public void afterConnectionCreation(java.sql.Connection connection)
Description copied from class: Translator
Provides a hook to call source specific logic when a connection is created. defect request 13979 & 13978

Overrides:
afterConnectionCreation in class Translator

getDefaultCapabilities

public java.lang.Class<? extends ConnectorCapabilities> getDefaultCapabilities()
Description copied from class: Translator
Get the default capabilities class. Will be used by Translator.getConnectorCapabilities() to return a capabilities instance.

Overrides:
getDefaultCapabilities in class Translator
Returns:

useParensForJoins

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

Overrides:
useParensForJoins in class Translator
Returns:


Copyright © 2009. All Rights Reserved.