Top Description Fields Constructors Methods
org.hibernate.dialect

public Class MySQLDialect

extends Dialect
Class Inheritance
Known Direct Subclasses
org.hibernate.dialect.MySQLInnoDBDialect, org.hibernate.dialect.MySQLMyISAMDialect, org.hibernate.dialect.MySQL5Dialect
Annotations
@SuppressWarnings:deprecation
Imports
java.sql.CallableStatement, .DatabaseMetaData, .ResultSet, .SQLException, .Types, java.util.regex.Matcher, .Pattern, org.hibernate.JDBCException, .NullPrecedence, .PessimisticLockException, org.hibernate.boot.TempTableDdlTransactionHandling, org.hibernate.cfg.Environment, org.hibernate.dialect.function.NoArgSQLFunction, .StandardSQLFunction, org.hibernate.dialect.identity.IdentityColumnSupport, .MySQLIdentityColumnSupport, org.hibernate.dialect.pagination.AbstractLimitHandler, .LimitHandler, .LimitHelper, org.hibernate.dialect.unique.MySQLUniqueDelegate, .UniqueDelegate, org.hibernate.engine.jdbc.env.spi.IdentifierCaseStrategy, .IdentifierHelper, .IdentifierHelperBuilder, .NameQualifierSupport, org.hibernate.engine.spi.RowSelection, org.hibernate.exception.LockAcquisitionException, .LockTimeoutException, org.hibernate.exception.spi.SQLExceptionConversionDelegate, org.hibernate.hql.spi.id.IdTableSupportStandardImpl, .MultiTableBulkIdStrategy, org.hibernate.hql.spi.id.local.AfterUseAction, .LocalTemporaryTableBulkIdStrategy, org.hibernate.internal.util.JdbcExceptionHelper, org.hibernate.mapping.Column, org.hibernate.type.StandardBasicTypes

An SQL dialect for MySQL (prior to 5.x).
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private static final Pattern
public static final String
private static final LimitHandler
private final MySQLStorageEngine
private final UniqueDelegate
Inherited from org.hibernate.dialect.Dialect:
CLOSED_QUOTEDEFAULT_BATCH_SIZELEGACY_LOB_MERGE_STRATEGYNEW_LOCATOR_LOB_MERGE_STRATEGYNO_BATCHQUOTESTANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGYSTREAM_XFER_LOB_MERGE_STRATEGYTWO_SINGLE_QUOTES_REPLACEMENT

Constructor Summary

AccessConstructor and Description
public
MySQLDialect()

Constructs a MySQLDialect

Method Summary

Modifier and TypeMethod and Description
public boolean
public IdentifierHelper
buildIdentifierHelper(IdentifierHelperBuilder
A semi-configured IdentifierHelper builder.
builder
,
DatabaseMetaData
Access to the metadata returned from the driver if needed and if available.

Warning

may be null

dbMetaData
)

Overrides org.hibernate.dialect.Dialect.buildIdentifierHelper.

Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
public SQLExceptionConversionDelegate
buildSQLExceptionConversionDelegate()

Overrides org.hibernate.dialect.Dialect.buildSQLExceptionConversionDelegate.

Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.
public boolean
canCreateCatalog()

Overrides org.hibernate.dialect.Dialect.canCreateCatalog.

Does this dialect support catalog creation?
public boolean
canCreateSchema()

Overrides org.hibernate.dialect.Dialect.canCreateSchema.

Does this dialect support schema creation?
public char
closeQuote()

Overrides org.hibernate.dialect.Dialect.closeQuote.

The character specific to this dialect used to close a quoted identifier.
public boolean
dropConstraints()

Overrides org.hibernate.dialect.Dialect.dropConstraints.

Do we need to drop constraints before dropping tables in this dialect?
protected String
escapeLiteral(String literal)

Overrides org.hibernate.dialect.Dialect.escapeLiteral.

Escape String literal.
protected String

Returns:

The proper cast target type.
fixedPointNumberCastTarget
()

Determine the cast target for Types#NUMERIC

protected String

Returns:

The proper cast target type.
floatingPointNumberCastTarget
()

Determine the cast target for Types#FLOAT and Types#REAL (DOUBLE)

public String
getAddColumnString()

Overrides org.hibernate.dialect.Dialect.getAddColumnString.

The syntax used to add a column to a table (optional).
public String
getAddForeignKeyConstraintString(String
The FK constraint name.
constraintName
,
String[]
The names of the columns comprising the FK
foreignKey
,
String
The table referenced by the FK
referencedTable
,
String[]
The explicit columns in the referencedTable referenced by this FK.
primaryKey
,
boolean
if false, constraint should be explicit about which column names the constraint refers to
referencesPrimaryKey
)

Overrides org.hibernate.dialect.Dialect.getAddForeignKeyConstraintString.

The syntax used to add a foreign key constraint to a table.
public String
getCastTypeName(int
The Types typecode
code
)

Overrides org.hibernate.dialect.Dialect.getCastTypeName.

Get the name of the database type appropriate for casting operations (via the CAST() SQL function) for the given Types typecode.
public String
getColumnComment(String
The comment to apply
comment
)

Overrides org.hibernate.dialect.Dialect.getColumnComment.

Get the comment into a form supported for column definition.
public String[]
getCreateCatalogCommand(String
The name of the catalog to be created.
catalogName
)

Overrides org.hibernate.dialect.Dialect.getCreateCatalogCommand.

Get the SQL command used to create the named catalog
public String[]
getCreateSchemaCommand(String
The name of the schema to be created.
schemaName
)

Overrides org.hibernate.dialect.Dialect.getCreateSchemaCommand.

Get the SQL command used to create the named schema
public String
getCurrentTimestampSelectString()

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

Retrieve the command used to retrieve the current timestamp from the database.
public MultiTableBulkIdStrategy
protected MySQLStorageEngine
public String[]
getDropCatalogCommand(String
The name of the catalog to be dropped.
catalogName
)

Overrides org.hibernate.dialect.Dialect.getDropCatalogCommand.

Get the SQL command used to drop the named catalog
public String
public String[]
getDropSchemaCommand(String
The name of the schema to be dropped.
schemaName
)

Overrides org.hibernate.dialect.Dialect.getDropSchemaCommand.

Get the SQL command used to drop the named schema
protected String
public String
getForUpdateString()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the string to append to SELECT statements to acquire locks for this dialect.
public IdentityColumnSupport
public LimitHandler
getLimitHandler()

Overrides org.hibernate.dialect.Dialect.getLimitHandler.

Returns the delegate managing LIMIT clause.
public String
getLimitString(String
The query to which to apply the limit.
sql
,
boolean
Is the query requesting an offset?
hasOffset
)

Overrides org.hibernate.dialect.Dialect.getLimitString.

Apply a limit clause to the query.
public NameQualifierSupport
getNameQualifierSupport()

Overrides org.hibernate.dialect.Dialect.getNameQualifierSupport.

By default interpret this based on DatabaseMetaData.
public String
getNotExpression(String
The expression to negate
expression
)

Overrides org.hibernate.dialect.Dialect.getNotExpression.

Negate an expression
public String
getReadLockString(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getReadLockString.

Get the string to append to SELECT statements to acquire READ locks for this dialect.
public ResultSet
getResultSet(CallableStatement
The callable statement.
ps
)

Overrides org.hibernate.dialect.Dialect.getResultSet.

Given a callable statement previously processed by registerResultSetOutParameter, extract the ResultSet from the OUT parameter.
public String
getSelectGUIDString()

Overrides org.hibernate.dialect.Dialect.getSelectGUIDString.

Get the command used to select a GUID from the underlying database.
public String
getTableComment(String
The comment to apply
comment
)

Overrides org.hibernate.dialect.Dialect.getTableComment.

Get the comment into a form supported for table definition.
public String
public UniqueDelegate
getUniqueDelegate()

Overrides org.hibernate.dialect.Dialect.getUniqueDelegate.

Get the UniqueDelegate supported by this dialect
public String
getWriteLockString(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getWriteLockString.

Get the string to append to SELECT statements to acquire WRITE locks for this dialect.
public boolean
hasSelfReferentialForeignKeyBug()

Overrides org.hibernate.dialect.Dialect.hasSelfReferentialForeignKeyBug.

Does the database/driver have bug in deleting rows that refer to other rows being deleted in the same query?
public boolean
public boolean
isJdbcLogWarningsEnabledByDefault()

Overrides org.hibernate.dialect.Dialect.isJdbcLogWarningsEnabledByDefault.

Does the fetching JDBC statement warning for logging is enabled by default
public char
openQuote()

Overrides org.hibernate.dialect.Dialect.openQuote.

The character specific to this dialect used to begin a quoted identifier.
public boolean
qualifyIndexName()

Overrides org.hibernate.dialect.Dialect.qualifyIndexName.

Do we need to qualify index names with the schema name?
public int
registerResultSetOutParameter(CallableStatement
The callable statement.
statement
,
int
The bind position at which to register the output param.
col
)

Overrides org.hibernate.dialect.Dialect.registerResultSetOutParameter.

Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returning ResultSet *by position*.
protected void
public String
renderOrderByElement(String
The SQL order expression. In case of @OrderBy annotation user receives property placeholder (e.g. attribute name enclosed in '{' and '}' signs).
expression
,
String
Collation string in format collate IDENTIFIER, or null if expression has not been explicitly specified.
collation
,
String
Order direction. Possible values: asc, desc, or null if expression has not been explicitly specified.
order
,
NullPrecedence
Nulls precedence. Default value: NullPrecedence#NONE.
nulls
)

Overrides org.hibernate.dialect.Dialect.renderOrderByElement.

Renders an ordering fragment
protected String

Returns:

The proper cast target type.
smallIntegerCastTarget
()

Determine the cast target for Types#INTEGER, Types#BIGINT and Types#SMALLINT

public boolean
supportsCascadeDelete()

Overrides org.hibernate.dialect.Dialect.supportsCascadeDelete.

Does this dialect support cascaded delete on foreign key definitions?
public boolean
supportsCurrentTimestampSelection()

Overrides org.hibernate.dialect.Dialect.supportsCurrentTimestampSelection.

Does this dialect support a way to retrieve the database's current timestamp value?
public boolean
supportsEmptyInList()

Overrides org.hibernate.dialect.Dialect.supportsEmptyInList.

Does this dialect support empty IN lists?
public boolean
supportsIfExistsBeforeTableName()

Overrides org.hibernate.dialect.Dialect.supportsIfExistsBeforeTableName.

For dropping a table, can the phrase "if exists" be applied before the table name?
public boolean
supportsLimit()

Overrides org.hibernate.dialect.Dialect.supportsLimit.

Does this dialect support some form of limiting query results via a SQL clause?
public boolean
supportsLobValueChangePropogation()

Overrides org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Does the dialect support propagating changes to LOB values back to the database?
public boolean
supportsLockTimeouts()

Overrides org.hibernate.dialect.Dialect.supportsLockTimeouts.

Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.
public boolean
supportsRowValueConstructorSyntax()

Overrides org.hibernate.dialect.Dialect.supportsRowValueConstructorSyntax.

Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.
public boolean
supportsRowValueConstructorSyntaxInSet()

Overrides org.hibernate.dialect.Dialect.supportsRowValueConstructorSyntaxInSet.

Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax, sometimes called tuple syntax, in the SET clause;

Basically, does it support syntax like "...

public boolean
public boolean
supportsSubqueryOnMutatingTable()

Overrides org.hibernate.dialect.Dialect.supportsSubqueryOnMutatingTable.

Does this dialect support referencing the table being mutated in a subquery.
Inherited from org.hibernate.dialect.Dialect:
addSqlHintOrCommentappendLockHintappendLockHintapplyLocksToSqlaugmentPhysicalTableTypesaugmentRecognizedTableTypesbindLimitParametersFirstbindLimitParametersInReverseOrderbuildSQLExceptionConvertercastcastcastcontributeTypesconvertToFirstRowValuecreateCaseFragmentcreateOuterJoinFragmentdefaultScrollModedoesReadCommittedCauseWritersToBlockReadersdoesRepeatableReadCauseReadersToBlockWritersequivalentTypesescapeCommentforceLimitUsageforceLobAsLastValueforUpdateOfColumnsgetAddColumnSuffixStringgetAddForeignKeyConstraintStringgetAddPrimaryKeyConstraintStringgetAddUniqueConstraintStringgetAlterTableStringgetAuxiliaryDatabaseObjectExportergetCallableStatementSupportgetCascadeConstraintsStringgetCaseInsensitiveLikegetColumnAliasExtractorgetCreateMultisetTableStringgetCreateSequenceStringgetCreateSequenceStringgetCreateSequenceStringsgetCreateSequenceStringsgetCreateTableStringgetCreateTemporaryTableColumnAnnotationgetCrossJoinSeparatorgetCurrentSchemaCommandgetCurrentTimestampSQLFunctionNamegetDefaultBatchLoadSizingStrategygetDefaultPropertiesgetDialectgetDialectgetDropSequenceStringgetDropSequenceStringsgetDropTableStringgetForeignKeyExportergetForUpdateNowaitStringgetForUpdateNowaitStringgetForUpdateSkipLockedStringgetForUpdateSkipLockedStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetFunctionsgetHibernateTypeNamegetHibernateTypeNamegetIndexExportergetInExpressionCountLimitgetKeywordsgetLimitStringgetLobMergeStrategygetLockingStrategygetLowercaseFunctiongetMaxAliasLengthgetNativeIdentifierGeneratorClassgetNativeIdentifierGeneratorStrategygetNoColumnsInsertStringgetNullColumnStringgetQueryHintStringgetQueryHintStringgetQuerySequencesStringgetReadLockStringgetResultSetgetResultSetgetSchemaNameResolvergetSelectClauseNullStringgetSelectSequenceNextValStringgetSequenceExportergetSequenceInformationExtractorgetSequenceNextValStringgetSqlTypeDescriptorOverridegetTableExportergetTypeNamegetTypeNamegetUniqueKeyExportergetViolatedConstraintNameExtractergetWriteLockStringhasAlterTableinlineLiteralisLegacyLimitHandlerBehaviorEnabledisLockTimeoutParameterizedisTypeNameRegisteredprependCommentquoteregisterColumnTyperegisterColumnTyperegisterFunctionregisterHibernateTyperegisterHibernateTyperegisterKeywordregisterResultSetOutParameterremapSqlTypeDescriptorreplaceResultVariableInOrderByClauseWithPositionrequiresCastingOfParametersInSelectClauserequiresParensForTupleDistinctCountssupportsBindAsCallableArgumentsupportsCaseInsensitiveLikesupportsCircularCascadeDeleteConstraintssupportsColumnChecksupportsCommentOnsupportsExistsInSelectsupportsExpectedLobUsagePatternsupportsIfExistsAfterAlterTablesupportsIfExistsAfterConstraintNamesupportsIfExistsAfterTableNamesupportsIfExistsBeforeConstraintNamesupportsJdbcConnectionLobCreationsupportsLimitOffsetsupportsNamedParameterssupportsNationalizedTypessupportsNoColumnsInsertsupportsNonQueryWithCTEsupportsNotNullUniquesupportsNoWaitsupportsOuterJoinForUpdatesupportsParametersInInsertSelectsupportsPartitionBysupportsPooledSequencessupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsRowValueConstructorSyntaxInInListsupportsSequencessupportsSkipLockedsupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTupleCountssupportsTupleDistinctCountssupportsTuplesInSubqueriessupportsUnboundedLobLocatorMaterializationsupportsUnionAllsupportsUniquesupportsUniqueConstraintInCreateAlterTablesupportsValuesListsupportsVariableLimittoBooleanValueStringtoStringtransformSelectStringuseFollowOnLockinguseFollowOnLockinguseInputStreamToInsertBlobuseMaxForLimit