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, usesStringBindingconversionManager, 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, writeParameterMarkeraddOperator, 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, usesPlatformDefaultSequenceprotected void appendDate(java.sql.Date date,
java.io.Writer writer)
throws java.io.IOException
appendDate in class DatabasePlatformjava.io.IOExceptionprotected void appendTime(java.sql.Time time,
java.io.Writer writer)
throws java.io.IOException
appendTime in class DatabasePlatformjava.io.IOExceptionprotected void appendTimestamp(java.sql.Timestamp timestamp,
java.io.Writer writer)
throws java.io.IOException
appendTimestamp in class DatabasePlatformjava.io.IOExceptionprotected void appendCalendar(java.util.Calendar calendar,
java.io.Writer writer)
throws java.io.IOException
appendCalendar in class DatabasePlatformjava.io.IOExceptionprotected java.util.Hashtable buildFieldTypes()
buildFieldTypes in class DatabasePlatformpublic ValueReadQuery buildSelectQueryForNativeSequence()
buildSelectQueryForNativeSequence in class DatabasePlatformpublic java.lang.String getConstraintDeletionString()
getConstraintDeletionString in class DatabasePlatformpublic java.lang.String getSelectForUpdateString()
getSelectForUpdateString in class DatabasePlatformpublic ValueReadQuery getTimestampQuery()
getTimestampQuery in interface PlatformgetTimestampQuery in class DatasourcePlatformpublic boolean isMySQL()
isMySQL in interface PlatformisMySQL in class DatasourcePlatformprotected void initializePlatformOperators()
initializePlatformOperators in class DatasourcePlatformprotected 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 DatabasePlatformValidationExceptionpublic boolean shouldNativeSequenceAcquireValueAfterInsert()
shouldNativeSequenceAcquireValueAfterInsert in class DatabasePlatformpublic boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax in class DatabasePlatformpublic boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers in class DatabasePlatformpublic boolean supportsGlobalTempTables()
supportsGlobalTempTables in class DatabasePlatformprotected java.lang.String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix in class DatabasePlatformpublic boolean shouldAlwaysUseTempStorageForModifyAll()
shouldAlwaysUseTempStorageForModifyAll in class DatabasePlatformpublic void writeUpdateOriginalFromTempTableSql(java.io.Writer writer,
DatabaseTable table,
java.util.Collection pkFields,
java.util.Collection assignedFields)
throws java.io.IOException
writeUpdateOriginalFromTempTableSql in class DatabasePlatformjava.io.IOExceptionpublic 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 DatabasePlatformjava.io.IOException