public class MySQLPlatform extends DatabasePlatform
Purpose: Provides MySQL specific behavior.
Responsibilities:
DEFAULT_VARCHAR_SIZEDEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE, IS_VALID_TIMEOUT, shouldIgnoreCaseOnFieldComparisons, Types_NCLOB, Types_SQLXML| Constructor and Description |
|---|
MySQLPlatform() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
buildProcedureCallString(StoredProcedureCall call,
AbstractSession session,
AbstractRecord row)
Return the stored procedure syntax for this platform.
|
ValueReadQuery |
buildSelectQueryForIdentity()
INTERNAL:
Build the identity query for native sequencing.
|
boolean |
canBatchWriteWithOptimisticLocking(DatabaseCall call)
INTERNAL:
Supports Batch Writing with Optimistic Locking.
|
int |
computeMaxRowsForSQL(int firstResultIndex,
int maxResults)
INTERNAL:
Use the JDBC maxResults and firstResultIndex setting to compute a value to use when
limiting the results of a query in SQL.
|
java.lang.String |
getConstraintDeletionString()
INTERNAL:
Used for constraint deletion.
|
java.lang.String |
getDropDatabaseSchemaString(java.lang.String schema)
Return the drop schema definition.
|
java.lang.String |
getFunctionCallHeader()
Used for stored function calls.
|
java.lang.String |
getIdentifierQuoteCharacter()
Deprecated.
|
java.lang.String |
getInOutputProcedureToken()
INTERNAL:
MySQL uses the INOUT keyword for this.
|
java.lang.String |
getProcedureAsString()
MySQL does not use the AS token.
|
java.lang.String |
getProcedureBeginString()
INTERNAL:
MySQL requires BEGIN.
|
java.lang.String |
getProcedureCallHeader()
INTERNAL:
Used for stored procedure calls.
|
java.lang.String |
getProcedureCallTail()
Used for sp calls.
|
java.lang.String |
getProcedureEndString()
INTERNAL:
MySQL requires END.
|
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.
|
java.lang.String |
getUniqueConstraintDeletionString()
INTERNAL:
Used for unique constraint deletion.
|
void |
initializeConnectionData(java.sql.Connection connection)
INTERNAL:
Allow initialization from the connection.
|
boolean |
isForUpdateCompatibleWithDistinct()
INTERNAL:
Indicates whether SELECT DISTINCT ...
|
boolean |
isFractionalTimeSupported() |
boolean |
isMySQL()
Answers whether platform is MySQL.
|
void |
printFieldIdentityClause(java.io.Writer writer)
INTERNAL:
Append the receiver's field 'identity' constraint clause to a writer.
|
void |
printSQLSelectStatement(DatabaseCall call,
ExpressionSQLPrinter printer,
SQLSelectStatement statement)
INTERNAL:
Print the SQL representation of the statement on a stream, storing the fields
in the DatabaseCall.
|
void |
printStoredFunctionReturnKeyWord(java.io.Writer writer)
INTERNAL:
Prints return keyword for StoredFunctionDefinition:
CREATE FUNCTION StoredFunction_In (P_IN BIGINT)
RETURN BIGINT
The method was introduced because MySQL requires "RETURNS" instead:
CREATE FUNCTION StoredFunction_In (P_IN BIGINT)
RETURNS BIGINT
|
boolean |
requiresProcedureBrackets()
Used for stored procedure creation: MySQL platforms need brackets around arguments declaration even if no arguments exist.
|
boolean |
requiresTableInIndexDropDDL()
INTERNAL:
Return if this database requires the table name when dropping an index.
|
boolean |
shouldAlwaysUseTempStorageForModifyAll()
INTERNAL:
MySQL supports temp tables for update-all, delete-all queries.
|
boolean |
shouldPrintForUpdateClause()
INTERNAL:
MySQL FOR UPDATE clause has to be the last
|
boolean |
shouldPrintOutputTokenAtStart()
INTERNAL:
MySQL requires the direction at the start of the argument.
|
boolean |
shouldPrintStoredProcedureArgumentNameInCall()
INTERNAL:
MySQL stored procedure calls do not require the argument name be printed in the call string
e.g.
|
boolean |
shouldUseJDBCOuterJoinSyntax()
INTERNAL:
JDBC defines an outer join syntax which many drivers do not support.
|
boolean |
supportsAutoConversionToNumericForArithmeticOperations()
Some db allow VARCHAR db field to be used in arithmetic operations automatically converting them to numeric:
UPDATE OL_PHONE SET PHONE_ORDER_VARCHAR = (PHONE_ORDER_VARCHAR + 1) WHERE ...
|
boolean |
supportsCountDistinctWithMultipleFields()
INTERNAL:
Indicates whether the platform supports the count distinct function with multiple fields.
|
boolean |
supportsGlobalTempTables()
INTERNAL:
MySQL supports temp tables for update-all, delete-all queries.
|
boolean |
supportsIdentity()
INTERNAL:
Indicates whether the platform supports identity.
|
boolean |
supportsIndividualTableLocking()
INTERNAL:
Indicates whether locking clause could be selectively applied only to some tables in a ReadQuery.
|
boolean |
supportsStoredFunctions() |
void |
writeDeleteFromTargetTableUsingTempTableSql(java.io.Writer writer,
DatabaseTable table,
DatabaseTable targetTable,
java.util.Collection pkFields,
java.util.Collection targetPkFields,
DatasourcePlatform platform)
INTERNAL:
Writes MySQL specific SQL for accessing temp tables for delete-all queries.
|
void |
writeUpdateOriginalFromTempTableSql(java.io.Writer writer,
DatabaseTable table,
java.util.Collection pkFields,
java.util.Collection assignedFields)
INTERNAL:
Writes MySQL specific SQL for accessing temp tables for update-all queries.
|
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendLiteralToCall, appendParameter, appendParameterInternal, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBuildCallWithReturning, commitTransaction, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getCreateDatabaseSchemaString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getDropCascadeString, getFieldTypeDefinition, getFieldTypes, getIndexNamePrefix, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxFieldNameSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getPartitioningCallback, getPingSQL, getProcedureArgumentSetter, getProcedureArgumentString, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTempTableForTable, getTransactionIsolation, getTypeConverters, getUseNationalCharacterVaryingTypeForString, getVPDClearIdentifierQuery, getVPDCreationFunctionString, getVPDCreationPolicyString, getVPDDeletionString, getVPDSetIdentifierQuery, hasPartitioningCallback, initialize, isAlterSequenceObjectSupported, isCastRequired, isDynamicSQLRequiredForFunctions, isInformixOuterJoin, isJDBCExecuteCompliant, isLobCompatibleWithDistinct, isLockTimeoutException, isNullAllowedInSelectClause, isOutputAllowWithResultSet, isRowCountOutputParameterRequired, isXDBDocument, maximumNumericValues, minimumNumericValues, minimumTimeIncrement, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printValuelist, printValuelist, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setCursorCode, setDriverName, setDriverSupportsNVarChar, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStoredProcedureTerminationToken, setStringBindingSize, setSupportsAutoCommit, setTableCreationSuffix, setTransactionIsolation, setUseJDBCStoredProcedureSyntax, setUseNationalCharacterVaryingTypeForString, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsConnectionUserName, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsIndexes, supportsLocalTempTables, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, supportsVPD, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeAddColumnClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeInsertIntoTableSql, writeLOB, writeParameterMarker, writeTableCreationSuffixaddSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, isODBC, isOracle, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsNativeSequenceNumbers, supportsSequenceObjects, toString, usesPlatformDefaultSequencepublic void initializeConnectionData(java.sql.Connection connection)
throws java.sql.SQLException
DatabasePlatforminitializeConnectionData in class DatabasePlatformjava.sql.SQLExceptionpublic boolean isFractionalTimeSupported()
public ValueReadQuery buildSelectQueryForIdentity()
buildSelectQueryForIdentity in class DatasourcePlatformpublic java.lang.String buildProcedureCallString(StoredProcedureCall call, AbstractSession session, AbstractRecord row)
buildProcedureCallString in class DatabasePlatformpublic int computeMaxRowsForSQL(int firstResultIndex,
int maxResults)
computeMaxRowsForSQL in class DatabasePlatformfirstResultIndex - maxResults - MySQLPlatformpublic boolean canBatchWriteWithOptimisticLocking(DatabaseCall call)
canBatchWriteWithOptimisticLocking in class DatabasePlatformpublic java.lang.String getConstraintDeletionString()
getConstraintDeletionString in class DatabasePlatformpublic java.lang.String getUniqueConstraintDeletionString()
getUniqueConstraintDeletionString in class DatabasePlatformpublic java.lang.String getFunctionCallHeader()
getFunctionCallHeader in class DatabasePlatformpublic java.lang.String getProcedureCallTail()
getProcedureCallTail in class DatabasePlatformpublic java.lang.String getSelectForUpdateString()
getSelectForUpdateString in class DatabasePlatformpublic boolean isForUpdateCompatibleWithDistinct()
DatabasePlatformisForUpdateCompatibleWithDistinct in class DatabasePlatformpublic ValueReadQuery getTimestampQuery()
getTimestampQuery in interface PlatformgetTimestampQuery in class DatasourcePlatformpublic boolean isMySQL()
isMySQL in interface PlatformisMySQL in class DatasourcePlatformpublic void printFieldIdentityClause(java.io.Writer writer)
throws ValidationException
printFieldIdentityClause in class DatabasePlatformValidationExceptionpublic boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax in class DatabasePlatformpublic boolean supportsIdentity()
supportsIdentity in class DatasourcePlatformpublic boolean supportsCountDistinctWithMultipleFields()
supportsCountDistinctWithMultipleFields in class DatabasePlatformpublic boolean requiresTableInIndexDropDDL()
requiresTableInIndexDropDDL in class DatabasePlatformpublic boolean supportsGlobalTempTables()
supportsGlobalTempTables in class DatabasePlatformpublic boolean supportsIndividualTableLocking()
supportsIndividualTableLocking in class DatabasePlatformpublic boolean supportsStoredFunctions()
supportsStoredFunctions in class DatabasePlatformpublic boolean supportsAutoConversionToNumericForArithmeticOperations()
supportsAutoConversionToNumericForArithmeticOperations in class DatabasePlatformpublic java.lang.String getDropDatabaseSchemaString(java.lang.String schema)
getDropDatabaseSchemaString in class DatabasePlatformpublic boolean shouldAlwaysUseTempStorageForModifyAll()
shouldAlwaysUseTempStorageForModifyAll in class DatabasePlatformpublic boolean shouldPrintStoredProcedureArgumentNameInCall()
shouldPrintStoredProcedureArgumentNameInCall in class DatabasePlatformpublic boolean shouldPrintForUpdateClause()
shouldPrintForUpdateClause in class DatabasePlatformpublic java.lang.String getIdentifierQuoteCharacter()
getIdentifierQuoteCharacter in class DatabasePlatformDatasourcePlatform.getStartDelimiter(),
DatasourcePlatform.getEndDelimiter()public java.lang.String getInOutputProcedureToken()
getInOutputProcedureToken in class DatabasePlatformpublic java.lang.String getProcedureAsString()
getProcedureAsString in class DatabasePlatformpublic boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart in class DatabasePlatformpublic java.lang.String getProcedureCallHeader()
getProcedureCallHeader in class DatabasePlatformpublic java.lang.String getProcedureBeginString()
getProcedureBeginString in class DatabasePlatformpublic java.lang.String getProcedureEndString()
getProcedureEndString 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,
DatasourcePlatform platform)
throws java.io.IOException
writeDeleteFromTargetTableUsingTempTableSql in class DatabasePlatformjava.io.IOExceptionpublic void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement)
DatabasePlatformprintSQLSelectStatement in class DatabasePlatformpublic boolean requiresProcedureBrackets()
requiresProcedureBrackets in class DatabasePlatformpublic void printStoredFunctionReturnKeyWord(java.io.Writer writer)
throws java.io.IOException
printStoredFunctionReturnKeyWord in class DatabasePlatformjava.io.IOExceptionEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference