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(Calendar calendar,
Writer writer)
INTERNAL:
Appends an MySQL specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendDate(Date date,
Writer writer)
INTERNAL:
Appends an MySQL specific date if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendTime(Time time,
Writer writer)
INTERNAL:
Appends an MySQL specific time if usesNativeSQL is true otherwise use the ODBC format.
|
protected void |
appendTimestamp(Timestamp timestamp,
Writer writer)
INTERNAL:
Appends an MySQL specific Timestamp, if usesNativeSQL is true otherwise use the ODBC format.
|
protected 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.
|
String |
getConstraintDeletionString()
INTERNAL:
Used for constraint deletion.
|
protected String |
getCreateTempTableSqlPrefix()
INTERNAL:
|
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(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(Writer writer,
DatabaseTable table,
DatabaseTable targetTable,
Collection pkFields,
Collection targetPkFields)
INTERNAL:
|
void |
writeUpdateOriginalFromTempTableSql(Writer writer,
DatabaseTable table,
Collection pkFields,
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(Date date, Writer writer) throws IOException
appendDate
in class DatabasePlatform
IOException
protected void appendTime(Time time, Writer writer) throws IOException
appendTime
in class DatabasePlatform
IOException
protected void appendTimestamp(Timestamp timestamp, Writer writer) throws IOException
appendTimestamp
in class DatabasePlatform
IOException
protected void appendCalendar(Calendar calendar, Writer writer) throws IOException
appendCalendar
in class DatabasePlatform
IOException
protected Hashtable buildFieldTypes()
buildFieldTypes
in class DatabasePlatform
public ValueReadQuery buildSelectQueryForNativeSequence()
buildSelectQueryForNativeSequence
in class DatabasePlatform
public String getConstraintDeletionString()
getConstraintDeletionString
in class DatabasePlatform
public 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(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 String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix
in class DatabasePlatform
public boolean shouldAlwaysUseTempStorageForModifyAll()
shouldAlwaysUseTempStorageForModifyAll
in class DatabasePlatform
public void writeUpdateOriginalFromTempTableSql(Writer writer, DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException
writeUpdateOriginalFromTempTableSql
in class DatabasePlatform
IOException
public void writeDeleteFromTargetTableUsingTempTableSql(Writer writer, DatabaseTable table, DatabaseTable targetTable, Collection pkFields, Collection targetPkFields) throws IOException
writeDeleteFromTargetTableUsingTempTableSql
in class DatabasePlatform
IOException
Copyright © 2022. All rights reserved.