public class MySQLDialect extends Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, NO_BATCH, QUOTE, STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY| Constructor and Description | 
|---|
| MySQLDialect()Constructs a MySQLDialect | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | areStringComparisonsCaseInsensitive()Are string comparisons implicitly case insensitive. | 
| SQLExceptionConversionDelegate | buildSQLExceptionConversionDelegate()Build an instance of a  SQLExceptionConversionDelegatefor
 interpreting dialect-specific error or SQLState codes. | 
| boolean | canCreateCatalog()Does this dialect support catalog creation? | 
| boolean | canCreateSchema()Does this dialect support schema creation? | 
| char | closeQuote()The character specific to this dialect used to close a quoted identifier. | 
| boolean | dropConstraints()Do we need to drop constraints before dropping tables in this dialect? | 
| protected String | escapeLiteral(String literal)Escape String literal. | 
| protected String | fixedPointNumberCastTarget()Determine the cast target for  Types.NUMERIC | 
| protected String | floatingPointNumberCastTarget()Determine the cast target for  Types.FLOATandTypes.REAL(DOUBLE) | 
| String | getAddColumnString()The syntax used to add a column to a table (optional). | 
| String | getAddForeignKeyConstraintString(String constraintName,
                                String[] foreignKey,
                                String referencedTable,
                                String[] primaryKey,
                                boolean referencesPrimaryKey)The syntax used to add a foreign key constraint to a table. | 
| String | getCastTypeName(int code)Get the name of the database type appropriate for casting operations
 (via the CAST() SQL function) for the given  Typestypecode. | 
| String | getColumnComment(String comment)Get the comment into a form supported for column definition. | 
| String[] | getCreateCatalogCommand(String catalogName)Get the SQL command used to create the named catalog | 
| String[] | getCreateSchemaCommand(String schemaName)Get the SQL command used to create the named schema | 
| String | getCurrentTimestampSelectString()Retrieve the command used to retrieve the current timestamp from the
 database. | 
| MultiTableBulkIdStrategy | getDefaultMultiTableBulkIdStrategy() | 
| protected MySQLStorageEngine | getDefaultMySQLStorageEngine() | 
| String[] | getDropCatalogCommand(String catalogName)Get the SQL command used to drop the named catalog | 
| String | getDropForeignKeyString() | 
| String[] | getDropSchemaCommand(String schemaName)Get the SQL command used to drop the named schema | 
| protected String | getEngineKeyword() | 
| String | getForUpdateString()Get the string to append to SELECT statements to acquire locks
 for this dialect. | 
| IdentityColumnSupport | getIdentityColumnSupport()Get the appropriate  IdentityColumnSupport | 
| LimitHandler | getLimitHandler()Returns the delegate managing LIMIT clause. | 
| String | getLimitString(String sql,
              boolean hasOffset)Apply s limit clause to the query. | 
| String | getNotExpression(String expression)Negate an expression | 
| String | getReadLockString(int timeout)Get the string to append to SELECT statements to acquire READ locks
 for this dialect. | 
| ResultSet | getResultSet(CallableStatement ps)Given a callable statement previously processed by  Dialect.registerResultSetOutParameter(java.sql.CallableStatement, int),
 extract theResultSetfrom the OUT parameter. | 
| String | getSelectGUIDString()Get the command used to select a GUID from the underlying database. | 
| String | getTableComment(String comment)Get the comment into a form supported for table definition. | 
| String | getTableTypeString() | 
| UniqueDelegate | getUniqueDelegate()Get the UniqueDelegate supported by this dialect | 
| String | getWriteLockString(int timeout)Get the string to append to SELECT statements to acquire WRITE locks
 for this dialect. | 
| boolean | hasSelfReferentialForeignKeyBug()Does the database/driver have bug in deleting rows that refer to other rows being deleted in the same query? | 
| boolean | isCurrentTimestampSelectStringCallable()Should the value returned by  Dialect.getCurrentTimestampSelectString()be treated as callable. | 
| boolean | isJdbcLogWarningsEnabledByDefault()Does the fetching JDBC statement warning for logging is enabled by default | 
| char | openQuote()The character specific to this dialect used to begin a quoted identifier. | 
| boolean | qualifyIndexName()Do we need to qualify index names with the schema name? | 
| int | registerResultSetOutParameter(CallableStatement statement,
                             int col)Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of
 returning  ResultSet*by position*. | 
| protected void | registerVarcharTypes() | 
| String | renderOrderByElement(String expression,
                    String collation,
                    String order,
                    NullPrecedence nulls)Renders an ordering fragment | 
| protected String | smallIntegerCastTarget() | 
| boolean | supportsCascadeDelete()Does this dialect support cascaded delete on foreign key definitions? | 
| boolean | supportsCurrentTimestampSelection()Does this dialect support a way to retrieve the database's current
 timestamp value? | 
| boolean | supportsEmptyInList()Does this dialect support empty IN lists?
 
 For example, is [where XYZ in ()] a supported construct? | 
| boolean | supportsIfExistsBeforeTableName()For dropping a table, can the phrase "if exists" be applied before the table name?
 
 NOTE : Only one or the other (or neither) of this and  Dialect.supportsIfExistsAfterTableName()should return true | 
| boolean | supportsLimit()Does this dialect support some form of limiting query results
 via a SQL clause? | 
| boolean | supportsLobValueChangePropogation()Does the dialect support propagating changes to LOB
 values back to the database?  Talking about mutating the
 internal value of the locator as opposed to supplying a new
 locator instance... | 
| boolean | supportsLockTimeouts()Informational metadata about whether this dialect is known to support
 specifying timeouts for requested lock acquisitions. | 
| boolean | supportsRowValueConstructorSyntax()Is this dialect known to support what ANSI-SQL terms "row value
 constructor" syntax; sometimes called tuple syntax. | 
| boolean | supportsSubqueryOnMutatingTable()Does this dialect support referencing the table being mutated in
 a subquery. | 
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, augmentRecognizedTableTypes, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConverter, cast, cast, cast, contributeTypes, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getColumnAliasExtractor, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getCurrentSchemaCommand, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropSequenceString, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNameQualifierSupport, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNullColumnString, getQueryHintString, getQueryHintString, getQuerySequencesString, getReadLockString, getResultSet, getResultSet, getSchemaNameResolver, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceExporter, getSequenceInformationExtractor, getSequenceNextValString, getSqlTypeDescriptorOverride, getTableExporter, getTypeName, getTypeName, getUniqueKeyExporter, getViolatedConstraintNameExtracter, getWriteLockString, hasAlterTable, inlineLiteral, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, prependComment, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, remapSqlTypeDescriptor, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsLimitOffset, supportsNamedParameters, supportsNationalizedTypes, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntaxInInList, supportsSequences, supportsSkipLocked, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTupleDistinctCounts, supportsTuplesInSubqueries, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimitprotected void registerVarcharTypes()
public String getAddColumnString()
DialectgetAddColumnString in class Dialectpublic boolean qualifyIndexName()
DialectqualifyIndexName in class Dialectpublic String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey)
DialectgetAddForeignKeyConstraintString in class DialectconstraintName - The FK constraint name.foreignKey - The names of the columns comprising the FKreferencedTable - The table referenced by the FKprimaryKey - The explicit columns in the referencedTable referenced
 by this FK.referencesPrimaryKey - if false, constraint should be
 explicit about which column names the constraint refers topublic boolean supportsLimit()
DialectsupportsLimit in class Dialectpublic String getDropForeignKeyString()
getDropForeignKeyString in class Dialectpublic LimitHandler getLimitHandler()
DialectgetLimitHandler in class Dialectpublic String getLimitString(String sql, boolean hasOffset)
Dialectvariable
 limit clauses when they support limits.  Thus, when building the
 select command we do not actually need to know the limit or the offest
 since we will just be using placeholders.
 
 Here we do still pass along whether or not an offset was specified
 so that dialects not supporting offsets can generate proper exceptions.
 In general, dialects will override one or the other of this method and
 Dialect.getLimitString(String, int, int).getLimitString in class Dialectsql - The query to which to apply the limit.hasOffset - Is the query requesting an offset?public char closeQuote()
DialectcloseQuote in class Dialectpublic char openQuote()
Dialectpublic boolean canCreateCatalog()
DialectcanCreateCatalog in class Dialectpublic String[] getCreateCatalogCommand(String catalogName)
DialectgetCreateCatalogCommand in class DialectcatalogName - The name of the catalog to be created.public String[] getDropCatalogCommand(String catalogName)
DialectgetDropCatalogCommand in class DialectcatalogName - The name of the catalog to be dropped.public boolean canCreateSchema()
DialectcanCreateSchema in class Dialectpublic String[] getCreateSchemaCommand(String schemaName)
DialectgetCreateSchemaCommand in class DialectschemaName - The name of the schema to be created.public String[] getDropSchemaCommand(String schemaName)
DialectgetDropSchemaCommand in class DialectschemaName - The name of the schema to be dropped.public boolean supportsIfExistsBeforeTableName()
DialectDialect.supportsIfExistsAfterTableName() should return truesupportsIfExistsBeforeTableName in class Dialecttrue if the "if exists" can be applied before the table namepublic String getSelectGUIDString()
DialectgetSelectGUIDString in class Dialectpublic String getTableComment(String comment)
DialectgetTableComment in class Dialectcomment - The comment to applypublic String getColumnComment(String comment)
DialectgetColumnComment in class Dialectcomment - The comment to applypublic MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
getDefaultMultiTableBulkIdStrategy in class Dialectpublic String getCastTypeName(int code)
DialectTypes typecode.getCastTypeName in class Dialectcode - The Types typecodeprotected String smallIntegerCastTarget()
protected String floatingPointNumberCastTarget()
Types.FLOAT and Types.REAL (DOUBLE)protected String fixedPointNumberCastTarget()
Types.NUMERICpublic boolean supportsCurrentTimestampSelection()
DialectsupportsCurrentTimestampSelection in class Dialectpublic boolean isCurrentTimestampSelectStringCallable()
DialectDialect.getCurrentTimestampSelectString()
 be treated as callable.  Typically this indicates that JDBC escape
 syntax is being used...isCurrentTimestampSelectStringCallable in class DialectDialect.getCurrentTimestampSelectString() return
 is callable; false otherwise.public String getCurrentTimestampSelectString()
DialectgetCurrentTimestampSelectString in class Dialectpublic int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException
DialectResultSet *by position*.  Pre-Java 8, registering such ResultSet-returning
 parameters varied greatly across database and drivers; hence its inclusion as part of the Dialect contract.registerResultSetOutParameter in class Dialectstatement - The callable statement.col - The bind position at which to register the output param.SQLException - Indicates problems registering the param.public ResultSet getResultSet(CallableStatement ps) throws SQLException
DialectDialect.registerResultSetOutParameter(java.sql.CallableStatement, int),
 extract the ResultSet from the OUT parameter.getResultSet in class Dialectps - The callable statement.SQLException - Indicates problems extracting the result set.public UniqueDelegate getUniqueDelegate()
DialectgetUniqueDelegate in class Dialectpublic boolean supportsRowValueConstructorSyntax()
DialectsupportsRowValueConstructorSyntax in class Dialectpublic String renderOrderByElement(String expression, String collation, String order, NullPrecedence nulls)
DialectrenderOrderByElement in class Dialectexpression - The SQL order expression. In case of @OrderBy annotation user receives property placeholder
 (e.g. attribute name enclosed in '{' and '}' signs).collation - Collation string in format collate IDENTIFIER, or null
 if expression has not been explicitly specified.order - Order direction. Possible values: asc, desc, or null
 if expression has not been explicitly specified.nulls - Nulls precedence. Default value: NullPrecedence.NONE.ORDER BY clause.public String getForUpdateString()
DialectgetForUpdateString in class Dialectpublic String getWriteLockString(int timeout)
DialectgetWriteLockString in class Dialecttimeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public String getReadLockString(int timeout)
DialectgetReadLockString in class Dialecttimeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public boolean supportsEmptyInList()
DialectsupportsEmptyInList in class Dialectpublic boolean areStringComparisonsCaseInsensitive()
DialectareStringComparisonsCaseInsensitive in class Dialectpublic boolean supportsLobValueChangePropogation()
DialectBlob.setBinaryStream(long),
 Blob.setBytes(long, byte[]),
 Blob.setBytes(long, byte[], int, int),
 or Blob.truncate(long).
 
 For CLOBs, the internal value might be changed by:
 Clob.setAsciiStream(long),
 Clob.setCharacterStream(long),
 Clob.setString(long, String),
 Clob.setString(long, String, int, int),
 or Clob.truncate(long).
 
 NOTE : I do not know the correct answer currently for
 databases which (1) are not part of the cruise control process
 or (2) do not Dialect.supportsExpectedLobUsagePattern().supportsLobValueChangePropogation in class Dialectpublic boolean supportsSubqueryOnMutatingTable()
DialectsupportsSubqueryOnMutatingTable in class Dialectpublic boolean supportsLockTimeouts()
DialectsupportsLockTimeouts in class Dialectpublic SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
DialectSQLExceptionConversionDelegate for
 interpreting dialect-specific error or SQLState codes.
 
 When Dialect.buildSQLExceptionConverter() returns null, the default 
 SQLExceptionConverter is used to interpret SQLState and
 error codes. If this method is overridden to return a non-null value,
 the default SQLExceptionConverter will use the returned
 SQLExceptionConversionDelegate in addition to the following 
 standard delegates:
 buildSQLExceptionConversionDelegate in class Dialectpublic String getNotExpression(String expression)
DialectgetNotExpression in class Dialectexpression - The expression to negatepublic IdentityColumnSupport getIdentityColumnSupport()
DialectIdentityColumnSupportgetIdentityColumnSupport in class Dialectpublic boolean isJdbcLogWarningsEnabledByDefault()
DialectisJdbcLogWarningsEnabledByDefault in class Dialectpublic boolean supportsCascadeDelete()
DialectsupportsCascadeDelete in class Dialecttrue indicates that the dialect does support cascaded delete on foreign keys.public String getTableTypeString()
getTableTypeString in class Dialectprotected String getEngineKeyword()
public boolean hasSelfReferentialForeignKeyBug()
DialecthasSelfReferentialForeignKeyBug in class Dialecttrue if the database/driver has this bugpublic boolean dropConstraints()
DialectdropConstraints in class Dialectprotected MySQLStorageEngine getDefaultMySQLStorageEngine()
protected String escapeLiteral(String literal)
DialectescapeLiteral in class DialectCopyright © 2019 JBoss by Red Hat. All rights reserved.