Package org.hibernate.dialect
Class MySQLDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.MySQLDialect
-
- All Implemented Interfaces:
ConversionContext
- Direct Known Subclasses:
MySQL5Dialect,MySQLInnoDBDialect,MySQLMyISAMDialect
public class MySQLDialect extends Dialect
An SQL dialect for MySQL (prior to 5.x).
-
-
Field Summary
Fields Modifier and Type Field Description static StringESCAPE_PATTERN_REPLACEMENT-
Fields inherited from class org.hibernate.dialect.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, TWO_SINGLE_QUOTES_REPLACEMENT
-
-
Constructor Summary
Constructors Constructor Description MySQLDialect()Constructs a MySQLDialect
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareStringComparisonsCaseInsensitive()Are string comparisons implicitly case insensitive.IdentifierHelperbuildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData)Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.SQLExceptionConversionDelegatebuildSQLExceptionConversionDelegate()Build an instance of aSQLExceptionConversionDelegatefor interpreting dialect-specific error or SQLState codes.booleancanCreateCatalog()Does this dialect support catalog creation?booleancanCreateSchema()Does this dialect support schema creation?charcloseQuote()The character specific to this dialect used to close a quoted identifier.booleandropConstraints()Do we need to drop constraints before dropping tables in this dialect?protected StringescapeLiteral(String literal)Escape String literal.protected StringfixedPointNumberCastTarget()Determine the cast target forTypes.NUMERICprotected StringfloatingPointNumberCastTarget()Determine the cast target forTypes.FLOATandTypes.REAL(DOUBLE)StringgetAddColumnString()The syntax used to add a column to a table (optional).StringgetAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey)The syntax used to add a foreign key constraint to a table.StringgetCastTypeName(int code)Get the name of the database type appropriate for casting operations (via the CAST() SQL function) for the givenTypestypecode.StringgetColumnComment(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 catalogString[]getCreateSchemaCommand(String schemaName)Get the SQL command used to create the named schemaStringgetCurrentTimestampSelectString()Retrieve the command used to retrieve the current timestamp from the database.MultiTableBulkIdStrategygetDefaultMultiTableBulkIdStrategy()protected MySQLStorageEnginegetDefaultMySQLStorageEngine()String[]getDropCatalogCommand(String catalogName)Get the SQL command used to drop the named catalogStringgetDropForeignKeyString()String[]getDropSchemaCommand(String schemaName)Get the SQL command used to drop the named schemaprotected StringgetEngineKeyword()StringgetForUpdateString()Get the string to append to SELECT statements to acquire locks for this dialect.IdentityColumnSupportgetIdentityColumnSupport()Get the appropriateIdentityColumnSupportLimitHandlergetLimitHandler()Returns the delegate managing LIMIT clause.StringgetLimitString(String sql, boolean hasOffset)Apply a limit clause to the query.NameQualifierSupportgetNameQualifierSupport()By default interpret this based on DatabaseMetaData.StringgetNotExpression(String expression)Negate an expressionStringgetReadLockString(int timeout)Get the string to append to SELECT statements to acquire READ locks for this dialect.ResultSetgetResultSet(CallableStatement ps)Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the OUT parameter.StringgetSelectGUIDString()Get the command used to select a GUID from the underlying database.StringgetTableComment(String comment)Get the comment into a form supported for table definition.StringgetTableTypeString()UniqueDelegategetUniqueDelegate()Get the UniqueDelegate supported by this dialectStringgetWriteLockString(int timeout)Get the string to append to SELECT statements to acquire WRITE locks for this dialect.booleanhasSelfReferentialForeignKeyBug()Does the database/driver have bug in deleting rows that refer to other rows being deleted in the same query?booleanisCurrentTimestampSelectStringCallable()Should the value returned byDialect.getCurrentTimestampSelectString()be treated as callable.booleanisJdbcLogWarningsEnabledByDefault()Does the fetching JDBC statement warning for logging is enabled by defaultcharopenQuote()The character specific to this dialect used to begin a quoted identifier.booleanqualifyIndexName()Do we need to qualify index names with the schema name?intregisterResultSetOutParameter(CallableStatement statement, int col)Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet*by position*.protected voidregisterVarcharTypes()StringrenderOrderByElement(String expression, String collation, String order, NullPrecedence nulls)Renders an ordering fragmentprotected StringsmallIntegerCastTarget()booleansupportsCascadeDelete()Does this dialect support cascaded delete on foreign key definitions?booleansupportsCurrentTimestampSelection()Does this dialect support a way to retrieve the database's current timestamp value?booleansupportsEmptyInList()Does this dialect support empty IN lists?booleansupportsIfExistsBeforeTableName()For dropping a table, can the phrase "if exists" be applied before the table name?booleansupportsLimit()Does this dialect support some form of limiting query results via a SQL clause?booleansupportsLobValueChangePropogation()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...booleansupportsLockTimeouts()Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.booleansupportsRowValueConstructorSyntax()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.booleansupportsRowValueConstructorSyntaxInSet()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax, sometimes called tuple syntax, in the SET clause;booleansupportsSelectAliasInGroupByClause()booleansupportsSubqueryOnMutatingTable()Does this dialect support referencing the table being mutated in a subquery.-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, cast, cast, cast, contributeTypes, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, equivalentTypes, escapeComment, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getColumnAliasExtractor, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTableColumnAnnotation, 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, 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, supportsJdbcConnectionLobCreation, supportsLimitOffset, supportsNamedParameters, supportsNationalizedTypes, supportsNoColumnsInsert, 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, useMaxForLimit
-
-
-
-
Field Detail
-
ESCAPE_PATTERN_REPLACEMENT
public static final String ESCAPE_PATTERN_REPLACEMENT
-
-
Method Detail
-
registerVarcharTypes
protected void registerVarcharTypes()
-
getAddColumnString
public String getAddColumnString()
Description copied from class:DialectThe syntax used to add a column to a table (optional).- Overrides:
getAddColumnStringin classDialect- Returns:
- The "add column" fragment.
-
qualifyIndexName
public boolean qualifyIndexName()
Description copied from class:DialectDo we need to qualify index names with the schema name?- Overrides:
qualifyIndexNamein classDialect- Returns:
- boolean
-
getAddForeignKeyConstraintString
public String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey)
Description copied from class:DialectThe syntax used to add a foreign key constraint to a table.- Overrides:
getAddForeignKeyConstraintStringin classDialect- Parameters:
constraintName- 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 to- Returns:
- the "add FK" fragment
-
supportsLimit
public boolean supportsLimit()
Description copied from class:DialectDoes this dialect support some form of limiting query results via a SQL clause?- Overrides:
supportsLimitin classDialect- Returns:
- True if this dialect supports some form of LIMIT.
-
getDropForeignKeyString
public String getDropForeignKeyString()
- Overrides:
getDropForeignKeyStringin classDialect
-
getLimitHandler
public LimitHandler getLimitHandler()
Description copied from class:DialectReturns the delegate managing LIMIT clause.- Overrides:
getLimitHandlerin classDialect- Returns:
- LIMIT clause delegate.
-
getLimitString
public String getLimitString(String sql, boolean hasOffset)
Description copied from class:DialectApply a limit clause to the query. Typically dialects utilizevariablelimit clauses when they support limits. Thus, when building the select command we do not actually need to know the limit or the offset 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 andDialect.getLimitString(String, int, int).- Overrides:
getLimitStringin classDialect- Parameters:
sql- The query to which to apply the limit.hasOffset- Is the query requesting an offset?- Returns:
- the modified SQL
-
closeQuote
public char closeQuote()
Description copied from class:DialectThe character specific to this dialect used to close a quoted identifier.- Overrides:
closeQuotein classDialect- Returns:
- The dialect's specific close quote character.
-
openQuote
public char openQuote()
Description copied from class:DialectThe character specific to this dialect used to begin a quoted identifier.
-
canCreateCatalog
public boolean canCreateCatalog()
Description copied from class:DialectDoes this dialect support catalog creation?- Overrides:
canCreateCatalogin classDialect- Returns:
- True if the dialect supports catalog creation; false otherwise.
-
getCreateCatalogCommand
public String[] getCreateCatalogCommand(String catalogName)
Description copied from class:DialectGet the SQL command used to create the named catalog- Overrides:
getCreateCatalogCommandin classDialect- Parameters:
catalogName- The name of the catalog to be created.- Returns:
- The creation commands
-
getDropCatalogCommand
public String[] getDropCatalogCommand(String catalogName)
Description copied from class:DialectGet the SQL command used to drop the named catalog- Overrides:
getDropCatalogCommandin classDialect- Parameters:
catalogName- The name of the catalog to be dropped.- Returns:
- The drop commands
-
canCreateSchema
public boolean canCreateSchema()
Description copied from class:DialectDoes this dialect support schema creation?- Overrides:
canCreateSchemain classDialect- Returns:
- True if the dialect supports schema creation; false otherwise.
-
getCreateSchemaCommand
public String[] getCreateSchemaCommand(String schemaName)
Description copied from class:DialectGet the SQL command used to create the named schema- Overrides:
getCreateSchemaCommandin classDialect- Parameters:
schemaName- The name of the schema to be created.- Returns:
- The creation commands
-
getDropSchemaCommand
public String[] getDropSchemaCommand(String schemaName)
Description copied from class:DialectGet the SQL command used to drop the named schema- Overrides:
getDropSchemaCommandin classDialect- Parameters:
schemaName- The name of the schema to be dropped.- Returns:
- The drop commands
-
supportsIfExistsBeforeTableName
public boolean supportsIfExistsBeforeTableName()
Description copied from class:DialectFor dropping a table, can the phrase "if exists" be applied before the table name? NOTE : Only one or the other (or neither) of this andDialect.supportsIfExistsAfterTableName()should return true- Overrides:
supportsIfExistsBeforeTableNamein classDialect- Returns:
trueif the "if exists" can be applied before the table name
-
getSelectGUIDString
public String getSelectGUIDString()
Description copied from class:DialectGet the command used to select a GUID from the underlying database. Optional operation.- Overrides:
getSelectGUIDStringin classDialect- Returns:
- The appropriate command.
-
getTableComment
public String getTableComment(String comment)
Description copied from class:DialectGet the comment into a form supported for table definition.- Overrides:
getTableCommentin classDialect- Parameters:
comment- The comment to apply- Returns:
- The comment fragment
-
getColumnComment
public String getColumnComment(String comment)
Description copied from class:DialectGet the comment into a form supported for column definition.- Overrides:
getColumnCommentin classDialect- Parameters:
comment- The comment to apply- Returns:
- The comment fragment
-
getDefaultMultiTableBulkIdStrategy
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
- Overrides:
getDefaultMultiTableBulkIdStrategyin classDialect
-
getCastTypeName
public String getCastTypeName(int code)
Description copied from class:DialectGet the name of the database type appropriate for casting operations (via the CAST() SQL function) for the givenTypestypecode.- Overrides:
getCastTypeNamein classDialect- Parameters:
code- TheTypestypecode- Returns:
- The database type name
-
smallIntegerCastTarget
protected String smallIntegerCastTarget()
- Returns:
- The proper cast target type.
-
floatingPointNumberCastTarget
protected String floatingPointNumberCastTarget()
Determine the cast target forTypes.FLOATandTypes.REAL(DOUBLE)- Returns:
- The proper cast target type.
-
fixedPointNumberCastTarget
protected String fixedPointNumberCastTarget()
Determine the cast target forTypes.NUMERIC- Returns:
- The proper cast target type.
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()
Description copied from class:DialectDoes this dialect support a way to retrieve the database's current timestamp value?- Overrides:
supportsCurrentTimestampSelectionin classDialect- Returns:
- True if the current timestamp can be retrieved; false otherwise.
-
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()
Description copied from class:DialectShould the value returned byDialect.getCurrentTimestampSelectString()be treated as callable. Typically this indicates that JDBC escape syntax is being used...- Overrides:
isCurrentTimestampSelectStringCallablein classDialect- Returns:
- True if the
Dialect.getCurrentTimestampSelectString()return is callable; false otherwise.
-
getCurrentTimestampSelectString
public String getCurrentTimestampSelectString()
Description copied from class:DialectRetrieve the command used to retrieve the current timestamp from the database.- Overrides:
getCurrentTimestampSelectStringin classDialect- Returns:
- The command.
-
registerResultSetOutParameter
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException
Description copied from class:DialectRegisters a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet*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.- Overrides:
registerResultSetOutParameterin classDialect- Parameters:
statement- The callable statement.col- The bind position at which to register the output param.- Returns:
- The number of (contiguous) bind positions used.
- Throws:
SQLException- Indicates problems registering the param.
-
getResultSet
public ResultSet getResultSet(CallableStatement ps) throws SQLException
Description copied from class:DialectGiven a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the OUT parameter.- Overrides:
getResultSetin classDialect- Parameters:
ps- The callable statement.- Returns:
- The extracted result set.
- Throws:
SQLException- Indicates problems extracting the result set.
-
getUniqueDelegate
public UniqueDelegate getUniqueDelegate()
Description copied from class:DialectGet the UniqueDelegate supported by this dialect- Overrides:
getUniqueDelegatein classDialect- Returns:
- The UniqueDelegate
-
supportsRowValueConstructorSyntax
public boolean supportsRowValueConstructorSyntax()
Description copied from class:DialectIs this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax. Basically, does it support syntax like "... where (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...".- Overrides:
supportsRowValueConstructorSyntaxin classDialect- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
-
supportsRowValueConstructorSyntaxInSet
public boolean supportsRowValueConstructorSyntaxInSet()
Description copied from class:DialectIs 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 "... SET (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...".- Overrides:
supportsRowValueConstructorSyntaxInSetin classDialect- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax in the SET clause; false otherwise.
-
renderOrderByElement
public String renderOrderByElement(String expression, String collation, String order, NullPrecedence nulls)
Description copied from class:DialectRenders an ordering fragment- Overrides:
renderOrderByElementin classDialect- Parameters:
expression- The SQL order expression. In case of@OrderByannotation user receives property placeholder (e.g. attribute name enclosed in '{' and '}' signs).collation- Collation string in formatcollate IDENTIFIER, ornullif expression has not been explicitly specified.order- Order direction. Possible values:asc,desc, ornullif expression has not been explicitly specified.nulls- Nulls precedence. Default value:NullPrecedence.NONE.- Returns:
- Renders single element of
ORDER BYclause.
-
getForUpdateString
public String getForUpdateString()
Description copied from class:DialectGet the string to append to SELECT statements to acquire locks for this dialect.- Overrides:
getForUpdateStringin classDialect- Returns:
- The appropriate FOR UPDATE clause string.
-
getWriteLockString
public String getWriteLockString(int timeout)
Description copied from class:DialectGet the string to append to SELECT statements to acquire WRITE locks for this dialect. Location of the returned string is treated the same as getForUpdateString.- Overrides:
getWriteLockStringin classDialect- Parameters:
timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate LOCK clause string.
-
getReadLockString
public String getReadLockString(int timeout)
Description copied from class:DialectGet the string to append to SELECT statements to acquire READ locks for this dialect. Location of the returned string is treated the same as getForUpdateString.- Overrides:
getReadLockStringin classDialect- Parameters:
timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate LOCK clause string.
-
supportsEmptyInList
public boolean supportsEmptyInList()
Description copied from class:DialectDoes this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?- Overrides:
supportsEmptyInListin classDialect- Returns:
- True if empty in lists are supported; false otherwise.
-
areStringComparisonsCaseInsensitive
public boolean areStringComparisonsCaseInsensitive()
Description copied from class:DialectAre string comparisons implicitly case insensitive. In other words, does [where 'XYZ' = 'xyz'] resolve to true?- Overrides:
areStringComparisonsCaseInsensitivein classDialect- Returns:
- True if comparisons are case insensitive.
-
supportsLobValueChangePropogation
public boolean supportsLobValueChangePropogation()
Description copied from class:DialectDoes 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... For BLOBs, the internal value might be changed by:Blob.setBinaryStream(long),Blob.setBytes(long, byte[]),Blob.setBytes(long, byte[], int, int), orBlob.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), orClob.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 notDialect.supportsExpectedLobUsagePattern().- Overrides:
supportsLobValueChangePropogationin classDialect- Returns:
- True if the changes are propagated back to the database; false otherwise.
-
supportsSubqueryOnMutatingTable
public boolean supportsSubqueryOnMutatingTable()
Description copied from class:DialectDoes this dialect support referencing the table being mutated in a subquery. The "table being mutated" is the table referenced in an UPDATE or a DELETE query. And so can that table then be referenced in a subquery of said UPDATE/DELETE query. For example, would the following two syntaxes be supported:- delete from TABLE_A where ID not in ( select ID from TABLE_A )
- update TABLE_A set NON_ID = 'something' where ID in ( select ID from TABLE_A)
- Overrides:
supportsSubqueryOnMutatingTablein classDialect- Returns:
- True if this dialect allows references the mutating table from a subquery.
-
supportsLockTimeouts
public boolean supportsLockTimeouts()
Description copied from class:DialectInformational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.- Overrides:
supportsLockTimeoutsin classDialect- Returns:
- True is this dialect supports specifying lock timeouts.
-
buildSQLExceptionConversionDelegate
public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
Description copied from class:DialectBuild an instance of aSQLExceptionConversionDelegatefor interpreting dialect-specific error or SQLState codes. WhenDialect.buildSQLExceptionConverter()returns null, the defaultSQLExceptionConverteris used to interpret SQLState and error codes. If this method is overridden to return a non-null value, the defaultSQLExceptionConverterwill use the returnedSQLExceptionConversionDelegatein addition to the following standard delegates:- a "static" delegate based on the JDBC 4 defined SQLException hierarchy;
- a delegate that interprets SQLState codes for either X/Open or SQL-2003 codes, depending on java.sql.DatabaseMetaData#getSQLStateType
- Overrides:
buildSQLExceptionConversionDelegatein classDialect- Returns:
- The SQLExceptionConversionDelegate for this dialect
-
getNameQualifierSupport
public NameQualifierSupport getNameQualifierSupport()
Description copied from class:DialectBy default interpret this based on DatabaseMetaData.- Overrides:
getNameQualifierSupportin classDialect- Returns:
- The NameQualifierSupport.
-
buildIdentifierHelper
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException
Description copied from class:DialectBuild the IdentifierHelper indicated by this Dialect for handling identifier conversions. Returningnullis allowed and indicates that Hibernate should fallback to building a "standard" helper. In the fallback path, any changes made to the IdentifierHelperBuilder during this call will still be incorporated into the built IdentifierHelper. The incoming builder will have the following set:IdentifierHelperBuilder.isGloballyQuoteIdentifiers()IdentifierHelperBuilder.getUnquotedCaseStrategy()- initialized to UPPERIdentifierHelperBuilder.getQuotedCaseStrategy()- initialized to MIXED
- Call
IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData) - Call
IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData) - Applies
AnsiSqlKeywords.sql2003()as reserved words - Applies the {#link #sqlKeywords} collected here as reserved words
- Applies the Dialect's NameQualifierSupport, if it defines one
- Overrides:
buildIdentifierHelperin classDialect- Parameters:
builder- A semi-configured IdentifierHelper builder.dbMetaData- Access to the metadata returned from the driver if needed and if available. WARNING: may benull- Returns:
- The IdentifierHelper instance to use, or
nullto indicate Hibernate should use its fallback path - Throws:
SQLException- Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.- See Also:
Dialect.getNameQualifierSupport()
-
getNotExpression
public String getNotExpression(String expression)
Description copied from class:DialectNegate an expression- Overrides:
getNotExpressionin classDialect- Parameters:
expression- The expression to negate- Returns:
- The negated expression
-
getIdentityColumnSupport
public IdentityColumnSupport getIdentityColumnSupport()
Description copied from class:DialectGet the appropriateIdentityColumnSupport- Overrides:
getIdentityColumnSupportin classDialect- Returns:
- the IdentityColumnSupport
-
isJdbcLogWarningsEnabledByDefault
public boolean isJdbcLogWarningsEnabledByDefault()
Description copied from class:DialectDoes the fetching JDBC statement warning for logging is enabled by default- Overrides:
isJdbcLogWarningsEnabledByDefaultin classDialect- Returns:
- boolean
-
supportsCascadeDelete
public boolean supportsCascadeDelete()
Description copied from class:DialectDoes this dialect support cascaded delete on foreign key definitions?- Overrides:
supportsCascadeDeletein classDialect- Returns:
trueindicates that the dialect does support cascaded delete on foreign keys.
-
getTableTypeString
public String getTableTypeString()
- Overrides:
getTableTypeStringin classDialect
-
getEngineKeyword
protected String getEngineKeyword()
-
hasSelfReferentialForeignKeyBug
public boolean hasSelfReferentialForeignKeyBug()
Description copied from class:DialectDoes the database/driver have bug in deleting rows that refer to other rows being deleted in the same query?- Overrides:
hasSelfReferentialForeignKeyBugin classDialect- Returns:
trueif the database/driver has this bug
-
dropConstraints
public boolean dropConstraints()
Description copied from class:DialectDo we need to drop constraints before dropping tables in this dialect?- Overrides:
dropConstraintsin classDialect- Returns:
- True if constraints must be dropped prior to dropping the table; false otherwise.
-
getDefaultMySQLStorageEngine
protected MySQLStorageEngine getDefaultMySQLStorageEngine()
-
escapeLiteral
protected String escapeLiteral(String literal)
Description copied from class:DialectEscape String literal.- Overrides:
escapeLiteralin classDialect- Returns:
- escaped String
-
supportsSelectAliasInGroupByClause
public boolean supportsSelectAliasInGroupByClause()
- Overrides:
supportsSelectAliasInGroupByClausein classDialect
-
-