public class MySQL4Platform extends DatabasePlatform
Purpose: Provides MySQL specific behaviour.
Responsibilities:
classTypes, cursorCode, fieldTypes, shouldBindAllParameters, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, stringBindingSize, supportsAutoCommit, transactionIsolation, usesByteArrayBinding, usesNativeSQL, usesStreamsForBinding, usesStringBinding
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultSequence, platformOperators, sequences, tableQualifier, timestampQuery
Constructor and Description |
---|
MySQL4Platform() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendCalendar(java.util.Calendar calendar,
java.io.Writer writer)
INTERNAL:
Appends an MySQL specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendDate(java.sql.Date date,
java.io.Writer writer)
INTERNAL:
Appends an MySQL specific date if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendTime(java.sql.Time time,
java.io.Writer writer)
INTERNAL:
Appends an MySQL specific time if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendTimestamp(java.sql.Timestamp timestamp,
java.io.Writer writer)
INTERNAL:
Appends an MySQL specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
|
protected java.util.Hashtable |
buildFieldTypes()
INTERNAL:
Return the mapping of class types to database types for the schema framework.
|
ValueReadQuery |
buildSelectQueryForNativeSequence()
INTERNAL:
Build the identity query for native sequencing.
|
protected ExpressionOperator |
dateToStringOperator()
INTERNAL:
Build MySQL equivalent to TO_CHAR.
|
java.lang.String |
getConstraintDeletionString()
INTERNAL:
Used for constraint deletion.
|
protected java.lang.String |
getCreateTempTableSqlPrefix()
INTERNAL:
|
java.lang.String |
getSelectForUpdateString()
INTERNAL:
Used for pessimistic locking.
|
ValueReadQuery |
getTimestampQuery()
INTERNAL:
This method returns the query to select the timestamp
from the server for MySQL.
|
protected void |
initializePlatformOperators()
INTERNAL:
Initialize any platform-specific operators
|
boolean |
isMySQL()
Answers whether platform is MySQL
|
protected ExpressionOperator |
leftTrim2()
INTERNAL:
Build MySQL equivalent to LTRIM(string_exp, character).
|
protected ExpressionOperator |
logOperator()
INTERNAL:
Create the 10 based log operator for this platform
|
void |
printFieldIdentityClause(java.io.Writer writer)
INTERNAL:
Append the receiver's field 'identity' constraint clause to a writer
|
protected ExpressionOperator |
rightTrim2()
INTERNAL:
Build MySQL equivalent to RTRIM(string_exp, character).
|
boolean |
shouldAlwaysUseTempStorageForModifyAll()
INTERNAL:
|
boolean |
shouldNativeSequenceAcquireValueAfterInsert()
INTERNAL:
If native sequencing is being used on Sybase then the values must be
retrieved after the insert.
|
boolean |
shouldUseJDBCOuterJoinSyntax()
INTERNAL:
JDBC defines an outer join syntax which many drivers do not support.
|
boolean |
supportsGlobalTempTables()
INTERNAL:
|
boolean |
supportsNativeSequenceNumbers()
INTERNAL:
Return true if the receiver uses host sequence numbers, generated on the database.
|
protected ExpressionOperator |
toCharOperator()
INTERNAL:
Build MySQL equivalent to TO_CHAR.
|
protected ExpressionOperator |
toDateOperator()
INTERNAL:
Build MySQL equivalent to TO_DATE.
|
protected ExpressionOperator |
toNumberOperator()
INTERNAL:
Build MySQL equivalent to TO_NUMBER.
|
void |
writeDeleteFromTargetTableUsingTempTableSql(java.io.Writer writer,
DatabaseTable table,
DatabaseTable targetTable,
java.util.Collection pkFields,
java.util.Collection targetPkFields)
INTERNAL:
|
void |
writeUpdateOriginalFromTempTableSql(java.io.Writer writer,
DatabaseTable table,
java.util.Collection pkFields,
java.util.Collection assignedFields)
INTERNAL:
|
allowsSizeInProcedureArguments, appendBoolean, appendByteArray, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildCallWithReturning, buildClassTypes, buildSelectQueryForNativeSequence, canBuildCallWithReturning, commitTransaction, convertToDatabaseType, copyInto, createPlatformDefaultSequence, dontBindUpdateAllQueryUsingTempTables, executeStoredProcedure, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getClassTypes, getCreateTempTableSqlBodyForTable, getCreateTempTableSqlSuffix, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getInOutputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJdbcTypeName, getMaxFieldNameSize, getMaxForeignKeyNameSize, getMaxUniqueKeyNameSize, getObjectFromResultSet, getOutputProcedureToken, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureAsString, getProcedureBeginString, getProcedureCallHeader, getProcedureCallTail, getProcedureEndString, getQualifiedSequenceTableName, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getTempTableForTable, getTransactionIsolation, isInformixOuterJoin, isNullAllowedInSelectClause, maximumNumericValues, minimumNumericValues, printFieldIdentityClause, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printValuelist, printValuelist, processResultSet, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, rollbackTransaction, setClassTypes, setCursorCode, setFieldTypes, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setPrimitiveParameterValue, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesByteArrayBinding, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAcquireSequenceValueAfterInsert, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintInOutputTokenBeforeType, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, supportsAutoCommit, supportsForeignKeyConstraints, supportsLocalTempTables, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueKeyConstraints, usesByteArrayBinding, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarker
addOperator, addSequence, clone, convertObject, createSequences, getConversionManager, getCustomModifyValueForCall, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getOperator, getPlatformOperators, getSequence, getSequences, getSequencesToWrite, getTableQualifier, getTimestampFromServer, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isHSQL, isInformix, isODBC, isOracle, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isTimesTen, platformSpecificSequencingInitialization, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultSequence, setSequences, setTableQualifier, setTimestampQuery, shouldUseCustomModifyForCall, toString, usesPlatformDefaultSequence
protected void appendDate(java.sql.Date date, java.io.Writer writer) throws java.io.IOException
appendDate
in class DatabasePlatform
java.io.IOException
protected void appendTime(java.sql.Time time, java.io.Writer writer) throws java.io.IOException
appendTime
in class DatabasePlatform
java.io.IOException
protected void appendTimestamp(java.sql.Timestamp timestamp, java.io.Writer writer) throws java.io.IOException
appendTimestamp
in class DatabasePlatform
java.io.IOException
protected void appendCalendar(java.util.Calendar calendar, java.io.Writer writer) throws java.io.IOException
appendCalendar
in class DatabasePlatform
java.io.IOException
protected java.util.Hashtable buildFieldTypes()
buildFieldTypes
in class DatabasePlatform
public ValueReadQuery buildSelectQueryForNativeSequence()
buildSelectQueryForNativeSequence
in class DatabasePlatform
public java.lang.String getConstraintDeletionString()
getConstraintDeletionString
in class DatabasePlatform
public java.lang.String getSelectForUpdateString()
getSelectForUpdateString
in class DatabasePlatform
public ValueReadQuery getTimestampQuery()
getTimestampQuery
in interface Platform
getTimestampQuery
in class DatasourcePlatform
public boolean isMySQL()
isMySQL
in interface Platform
isMySQL
in class DatasourcePlatform
protected void initializePlatformOperators()
initializePlatformOperators
in class DatasourcePlatform
protected ExpressionOperator logOperator()
protected ExpressionOperator toNumberOperator()
protected ExpressionOperator toDateOperator()
protected ExpressionOperator toCharOperator()
protected ExpressionOperator dateToStringOperator()
protected ExpressionOperator leftTrim2()
protected ExpressionOperator rightTrim2()
public void printFieldIdentityClause(java.io.Writer writer) throws ValidationException
printFieldIdentityClause
in class DatabasePlatform
ValidationException
public boolean shouldNativeSequenceAcquireValueAfterInsert()
shouldNativeSequenceAcquireValueAfterInsert
in class DatabasePlatform
public boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax
in class DatabasePlatform
public boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers
in class DatabasePlatform
public boolean supportsGlobalTempTables()
supportsGlobalTempTables
in class DatabasePlatform
protected java.lang.String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix
in class DatabasePlatform
public boolean shouldAlwaysUseTempStorageForModifyAll()
shouldAlwaysUseTempStorageForModifyAll
in class DatabasePlatform
public void writeUpdateOriginalFromTempTableSql(java.io.Writer writer, DatabaseTable table, java.util.Collection pkFields, java.util.Collection assignedFields) throws java.io.IOException
writeUpdateOriginalFromTempTableSql
in class DatabasePlatform
java.io.IOException
public void writeDeleteFromTargetTableUsingTempTableSql(java.io.Writer writer, DatabaseTable table, DatabaseTable targetTable, java.util.Collection pkFields, java.util.Collection targetPkFields) throws java.io.IOException
writeDeleteFromTargetTableUsingTempTableSql
in class DatabasePlatform
java.io.IOException