Class MariaDBDialect
- All Implemented Interfaces:
FunctionContributor,TypeContributor,ConversionContext
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hibernate.dialect.Dialect
Dialect.SizeStrategy, Dialect.SizeStrategyImpl -
Field Summary
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, FALSE_STRING_VALUES, LEGACY_LOB_MERGE_STRATEGY, LOG_BASE2OF10, NEW_LOCATOR_LOB_MERGE_STRATEGY, QUOTE, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY, TRUE_STRING_VALUES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData metadata) TheIdentifierHelperindicated by this dialect for handling identifier conversions.An instance ofSQLExceptionConversionDelegatefor interpreting dialect-specific error or SQLState codes.castPattern(CastType from, CastType to) Obtain a pattern for the SQL equivalent to acast()function call.voidcontributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) A callback which allows theDialectto contribute types.createOptionalTableUpdateOperation(EntityMutationTarget mutationTarget, OptionalTableUpdate optionalTableUpdate, SessionFactoryImplementor factory) Create aMutationOperationfor a updating an optional tablebooleanDoes this dialect round a temporal when converting from a precision higher to a lower one?booleanequivalentTypes(int typeCode1, int typeCode2) Do the given JDBC type codes, as defined inTypesrepresent essentially the same type in this dialect of SQL?How does this dialect support aggregate types likeSqlTypes.STRUCT.getDual()Returns a table expression that has one row.Get this dialect's level of support for primary key functional dependency analysis withinGROUP BYandORDER BYclauses.Get the appropriateIdentityColumnSupportfor this dialect.Access to various details and operations related to this Dialect's support for pessimistic locking.protected DatabaseVersionGet the version of the SQL dialect that is the minimum supported by this implementation.Determines whether this database requires the use of explicitly nationalized character (Unicode) data types.Get theselectcommand used retrieve the names of all sequences.ASequenceInformationExtractorwhich is able to extractSequenceInformationfrom the JDBC result set returned whenDialect.getQuerySequencesString()is executed.No support for sequences.AViolatedConstraintNameExtractorfor extracting the name of a violated constraint from aSQLException.voidinitializeFunctionRegistry(FunctionContributions functionContributions) Initialize the given registry with any dialect-specific functions.protected voidregisterColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Register ANSI-standard column types using the length limits defined byDialect.getMaxVarcharLength(),Dialect.getMaxNVarcharLength(), andDialect.getMaxVarbinaryLength().protected voidregisterKeyword(String word) Register a keyword.resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Assigns an appropriateJdbcTypeto a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.protected booleanbooleanDoes this dialect support column-level check constraints?protected booleanbooleanFor analter table, can the phraseif existsbe applied?booleanFor dropping a constraint with analter tablestatement, can the phraseif existsbe applied before the constraint name?booleanDoes this dialect fully support returning arbitrary generated column values after execution of aninsertstatement, using native SQL syntax?booleanbooleanDoes this dialect support the SQLlateralkeyword or a proprietary alternative?booleanDoes this dialect support named column-level check constraints?booleanDoes this dialect/database support recursive CTEs?booleanDoes this dialect fully support returning arbitrary generated column values after execution of anupdatestatement, using native SQL syntax?booleanDoes this dialect support window functions likerow_number() over (..)?booleanWhether the SQL with clause is supported within a subquery.Methods inherited from class org.hibernate.dialect.MySQLDialect
addPartitionKeyToPrimaryKey, appendBooleanValueString, appendCheckConstraintOptions, appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendLiteral, canCreateCatalog, canCreateSchema, canDisableConstraints, castType, closeQuote, columnType, createVersion, createVersion, currentTimestamp, datetimeFormat, dropConstraints, extractPattern, getAddForeignKeyConstraintString, getAlterColumnTypeString, getCharacterSetBytesPerCharacter, getColumnComment, getCreateCatalogCommand, getCreateSchemaCommand, getCurrentTimestampSelectString, getDefaultLobLength, getDefaultMySQLStorageEngine, getDisableConstraintsStatement, getDmlTargetColumnQualifierSupport, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropUniqueKeyString, getEnableConstraintsStatement, getEnumTypeDeclaration, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getFloatPrecision, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getFractionalSecondPrecisionInNanos, getGroupBySelectItemReferenceStrategy, getLimitHandler, getLocalTemporaryTableStrategy, getMaxAliasLength, getMaxIdentifierLength, getMaximumSeriesSize, getMaxVarbinaryLength, getMaxVarcharLength, getNameQualifierSupport, getNullColumnString, getNullOrdering, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getReadLockString, getReadLockString, getReadLockString, getReadLockString, getResultSet, getSelectGUIDString, getSizeStrategy, getSupportedTemporaryTableKind, getTableComment, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableDropCommand, getWriteLockString, getWriteLockString, getWriteLockString, getWriteLockString, hasSelfReferentialForeignKeyBug, initDefaultProperties, isCurrentTimestampSelectStringCallable, isJdbcLogWarningsEnabledByDefault, isNoBackslashEscapesEnabled, openQuote, qualifyIndexName, registerDefaultKeywords, registerResultSetOutParameter, resolveSqlTypeLength, stripsTrailingSpacesFromChar, supportsAlterColumnType, supportsBindingNullSqlTypeForSetNull, supportsCascadeDelete, supportsCommentOn, supportsCurrentTimestampSelection, supportsDistinctFromPredicate, supportsFromClauseInUpdate, supportsIfExistsBeforeTableName, supportsIsTrue, supportsJoinsInDelete, supportsLobValueChangePropagation, supportsNestedSubqueryCorrelation, supportsNullPrecedence, supportsOffsetInSubquery, supportsPartitionBy, supportsRowValueConstructorSyntaxInQuantifiedPredicates, supportsSubqueryOnMutatingTable, supportsTemporalLiteralOffset, timestampaddPattern, timestampdiffPattern, useMaterializedLobWhenCapacityExceededMethods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, addUseIndexQueryHint, appendArrayLiteral, appendBinaryLiteral, appendIntervalLiteral, appendIntervalLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildLockingClauseStrategy, buildOptimisticForceIncrementStrategy, buildOptimisticStrategy, buildPessimisticForceIncrementStrategy, buildPessimisticReadStrategy, buildPessimisticWriteStrategy, buildReadStrategy, buildStringToBooleanCast, buildStringToBooleanCastDecode, buildStringToBooleanDecode, canBatchTruncate, checkVersion, contribute, contributeFunctions, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestampWithTimeZone, defaultScrollMode, determineDatabaseVersion, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, escapeComment, forceLobAsLastValue, generatedAs, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCatalogSeparator, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckConstraintString, getColumnAliasExtractor, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getCurrentSchemaCommand, getDefaultDecimalPrecision, getDefaultIntervalSecondScale, getDefaultNonContextualLobCreation, getDefaultOrdinalityColumnName, getDefaultProperties, getDefaultStatementBatchSize, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintStatement, getDoublePrecision, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropTableString, getEnableConstraintStatement, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getForeignKeyExporter, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFromDualForSelectOnly, getGlobalTemporaryTableStrategy, getHqlTranslator, getIndexExporter, getInExpressionCountLimit, getKeywords, getLobMergeStrategy, getLockingClauseStrategy, getLockingStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarcharCapacity, getMultiKeyLoadSizingStrategy, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNativeValueGenerationStrategy, getNoColumnsInsertString, getNullColumnString, getParameterCountLimit, getPersistentTemporaryTableStrategy, getPessimisticLockStyle, getQueryHintString, getReadRowLockStrategy, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSelectClauseNullString, getSequenceExporter, getSqmTranslatorFactory, getTableCleaner, getTableExporter, getTableMigrator, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTimeZoneSupport, getTruncateTableStatement, getTruncateTableStatements, getUniqueDelegate, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, getWriteRowLockStrategy, hasAlterTable, hasDataTypeBeforeGeneratedAs, isEmptyStringTreatedAsNull, isLob, ordinal, prependComment, quote, quoteCollation, registerKeywords, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, requiresColumnListInCreateView, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, rowId, rowIdSqlType, supportsArrayConstructor, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBindingNullForSetObject, supportsBitType, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsConflictClauseForInsertCTE, supportsCrossJoin, supportsDuplicateSelectItemsInQueryGroup, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFilterClause, supportsForUpdate, supportsFractionalTimestampArithmetic, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeTypeName, supportsInsertReturningGeneratedKeys, supportsInsertReturningRowId, supportsJdbcConnectionLobCreation, supportsJoinInMutationStatementSubquery, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNamedParameters, supportsNationalizedMethods, supportsNestedWithClause, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNoWait, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsPredicateAsExpression, supportsRecursiveCycleClause, supportsRecursiveCycleUsingClause, supportsRecursiveSearchClause, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowConstructor, supportsRowValueConstructorDistinctFromSyntax, supportsRowValueConstructorGtLtSyntax, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInInSubQuery, supportsSimpleQueryGrouping, supportsSkipLocked, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTableOptions, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUserDefinedTypes, supportsValuesList, supportsValuesListForInsert, supportsWait, supportsWithClause, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useConnectionToCreateLob, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob
-
Constructor Details
-
MariaDBDialect
public MariaDBDialect() -
MariaDBDialect
-
MariaDBDialect
-
-
Method Details
-
getMySQLVersion
- Overrides:
getMySQLVersionin classMySQLDialect
-
getMinimumSupportedVersion
Description copied from class:DialectGet the version of the SQL dialect that is the minimum supported by this implementation.- Overrides:
getMinimumSupportedVersionin classMySQLDialect
-
getNationalizationSupport
Description copied from class:DialectDetermines whether this database requires the use of explicitly nationalized character (Unicode) data types.That is, whether the use of
Types.NCHAR,Types.NVARCHAR, andTypes.NCLOBis required for nationalized character data.- Overrides:
getNationalizationSupportin classDialect
-
initializeFunctionRegistry
Description copied from class:DialectInitialize the given registry with any dialect-specific functions.Support for certain SQL functions is required, and if the database does not support a required function, then the dialect must define a way to emulate it.
These required functions include the functions defined by the JPA query language specification:
-
avg(arg)- aggregate function -
count([distinct ]arg)- aggregate function -
max(arg)- aggregate function -
min(arg)- aggregate function -
sum(arg)- aggregate function
-
coalesce(arg0, arg1, ...) -
nullif(arg0, arg1)
-
lower(arg) -
upper(arg) -
length(arg) -
concat(arg0, arg1, ...) -
locate(pattern, string[, start]) -
substring(string, start[, length]) -
trim([[spec ][character ]from] string)
-
abs(arg) -
mod(arg0, arg1) -
sqrt(arg)
-
current date -
current time -
current timestamp
-
any(arg)- aggregate function -
every(arg)- aggregate function
-
var_samp(arg)- aggregate function -
var_pop(arg)- aggregate function -
stddev_samp(arg)- aggregate function -
stddev_pop(arg)- aggregate function
-
cast(arg as Type) -
extract(field from arg)
-
ln(arg) -
exp(arg) -
power(arg0, arg1) -
floor(arg) -
ceiling(arg)
-
position(pattern in string) -
substring(string from start[ for length]) -
overlay(string placing replacement from start[ for length])
java.timetypes:-
local date -
local time -
local datetime -
offset datetime -
instant
-
left(string, length) -
right(string, length) -
replace(string, pattern, replacement) -
pad(string with length spec[ character]) -
repeat(string, times)
-
pi -
log10(arg) -
log(base, arg) -
sign(arg) -
sin(arg) -
cos(arg) -
tan(arg) -
asin(arg) -
acos(arg) -
atan(arg) -
atan2(arg0, arg1) -
round(arg0[, arg1]) -
truncate(arg0[, arg1]) -
sinh(arg) -
tanh(arg) -
cosh(arg) -
least(arg0, arg1, ...) -
greatest(arg0, arg1, ...) -
degrees(arg) -
radians(arg) -
bitand(arg1, arg1) -
bitor(arg1, arg1) -
bitxor(arg1, arg1)
-
format(datetime as pattern) -
collate(string as collation) -
str(arg)- synonym ofcast(a as String) -
ifnull(arg0, arg1)- synonym ofcoalesce(a, b)
-
ordinal(arg) -
string(arg)
extract(), and desugared by the parser:-
second(arg)- synonym ofextract(second from a) -
minute(arg)- synonym ofextract(minute from a) -
hour(arg)- synonym ofextract(hour from a) -
day(arg)- synonym ofextract(day from a) -
month(arg)- synonym ofextract(month from a) -
year(arg)- synonym ofextract(year from a)
second()function returns a floating point value, contrary to the integer type returned by the native function with this name on many databases. Thus, we don't just naively map these HQL functions to the native SQL functions with the same names.- Overrides:
initializeFunctionRegistryin classMySQLDialect
-
-
registerColumnTypes
protected void registerColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Description copied from class:DialectRegister ANSI-standard column types using the length limits defined byDialect.getMaxVarcharLength(),Dialect.getMaxNVarcharLength(), andDialect.getMaxVarbinaryLength().This method is always called when a
Dialectis instantiated.- Overrides:
registerColumnTypesin classMySQLDialect
-
getAggregateSupport
Description copied from class:DialectHow does this dialect support aggregate types likeSqlTypes.STRUCT.- Overrides:
getAggregateSupportin classMySQLDialect
-
registerKeyword
Description copied from class:DialectRegister a keyword.- Overrides:
registerKeywordin classDialect- Parameters:
word- a reserved word in this SQL dialect
-
resolveSqlTypeDescriptor
public JdbcType resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Description copied from class:DialectAssigns an appropriateJdbcTypeto a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.- Overrides:
resolveSqlTypeDescriptorin classMySQLDialect- Parameters:
columnTypeName- the column type namejdbcTypeCode- thetype codeprecision- the precision or 0scale- the scale or 0- Returns:
- an appropriate instance of
JdbcType
-
contributeTypes
Description copied from class:DialectA callback which allows theDialectto contribute types.- Overrides:
contributeTypesin classMySQLDialect- Parameters:
typeContributions- Callback to contribute the typesserviceRegistry- The service registry
-
castPattern
Description copied from class:DialectObtain a pattern for the SQL equivalent to acast()function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.- Overrides:
castPatternin classMySQLDialect- Parameters:
from- aCastTypeindicating the type of the value argumentto- aCastTypeindicating the type the value argument is cast to
-
getSqlAstTranslatorFactory
Description copied from class:Dialect- Overrides:
getSqlAstTranslatorFactoryin classMySQLDialect- See Also:
-
supportsWindowFunctions
public boolean supportsWindowFunctions()Description copied from class:DialectDoes this dialect support window functions likerow_number() over (..)?- Overrides:
supportsWindowFunctionsin classMySQLDialect- Returns:
trueif the underlying database supports window functions,falseotherwise. The default isfalse.
-
supportsLateral
public boolean supportsLateral()Description copied from class:DialectDoes this dialect support the SQLlateralkeyword or a proprietary alternative?- Overrides:
supportsLateralin classMySQLDialect- Returns:
trueif the underlying database supports lateral,falseotherwise. The default isfalse.
-
supportsRecursiveCTE
public boolean supportsRecursiveCTE()Description copied from class:DialectDoes this dialect/database support recursive CTEs?- Overrides:
supportsRecursiveCTEin classMySQLDialect- Returns:
trueif recursive CTEs are supported
-
supportsColumnCheck
public boolean supportsColumnCheck()Description copied from class:DialectDoes this dialect support column-level check constraints?- Overrides:
supportsColumnCheckin classMySQLDialect- Returns:
- True if column-level
checkconstraints are supported; false otherwise.
-
supportsNamedColumnCheck
public boolean supportsNamedColumnCheck()Description copied from class:DialectDoes this dialect support named column-level check constraints?- Overrides:
supportsNamedColumnCheckin classDialect- Returns:
- True if named column-level
checkconstraints are supported; false otherwise.
-
doesRoundTemporalOnOverflow
public boolean doesRoundTemporalOnOverflow()Description copied from class:DialectDoes this dialect round a temporal when converting from a precision higher to a lower one?- Overrides:
doesRoundTemporalOnOverflowin classDialect- Returns:
- true if rounding is applied, false if truncation is applied
-
supportsIfExistsBeforeConstraintName
public boolean supportsIfExistsBeforeConstraintName()Description copied from class:DialectFor dropping a constraint with analter tablestatement, can the phraseif existsbe applied before the constraint name?- Overrides:
supportsIfExistsBeforeConstraintNamein classDialect- Returns:
trueifif existscan be applied before the constraint name
-
supportsIfExistsAfterAlterTable
public boolean supportsIfExistsAfterAlterTable()Description copied from class:DialectFor analter table, can the phraseif existsbe applied?- Overrides:
supportsIfExistsAfterAlterTablein classDialect- Returns:
trueifif existscan be applied afteralter table
-
getSequenceSupport
Description copied from class:MySQLDialectNo support for sequences.- Overrides:
getSequenceSupportin classMySQLDialect
-
getQuerySequencesString
Description copied from class:DialectGet theselectcommand used retrieve the names of all sequences.- Overrides:
getQuerySequencesStringin classDialect- Returns:
- The select command; or null if sequences are not supported.
-
getSequenceInformationExtractor
Description copied from class:DialectASequenceInformationExtractorwhich is able to extractSequenceInformationfrom the JDBC result set returned whenDialect.getQuerySequencesString()is executed.- Overrides:
getSequenceInformationExtractorin classDialect
-
getLockingSupport
Description copied from class:DialectAccess to various details and operations related to this Dialect's support for pessimistic locking.- Overrides:
getLockingSupportin classMySQLDialect
-
supportsAliasLocks
protected boolean supportsAliasLocks()- Overrides:
supportsAliasLocksin classMySQLDialect
-
supportsInsertReturning
public boolean supportsInsertReturning()Description copied from class:DialectDoes this dialect fully support returning arbitrary generated column values after execution of aninsertstatement, using native SQL syntax?Support for identity columns is insufficient here, we require something like:
insert ... returning ..., orselect from final table (insert ... ).
- Overrides:
supportsInsertReturningin classDialect- Returns:
truefor 10.6 and above because Maria supportsinsert ... returningeven though MySQL does not- See Also:
-
supportsUpdateReturning
public boolean supportsUpdateReturning()Description copied from class:DialectDoes this dialect fully support returning arbitrary generated column values after execution of anupdatestatement, using native SQL syntax?Defaults to the value of
Dialect.supportsInsertReturning()but can be overridden to explicitly disable this for updates.- Overrides:
supportsUpdateReturningin classDialect- See Also:
-
getIdentityColumnSupport
Description copied from class:DialectGet the appropriateIdentityColumnSupportfor this dialect.- Overrides:
getIdentityColumnSupportin classMySQLDialect- Returns:
- the IdentityColumnSupport
-
getFunctionalDependencyAnalysisSupport
Description copied from class:DialectGet this dialect's level of support for primary key functional dependency analysis withinGROUP BYandORDER BYclauses.- Overrides:
getFunctionalDependencyAnalysisSupportin classMySQLDialect
-
buildIdentifierHelper
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData metadata) throws SQLException Description copied from class:DialectTheIdentifierHelperindicated by this dialect for handling identifier conversions. Returningnullis allowed and indicates that Hibernate should fall back 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
By default, Hibernate will do the following:
- Call
IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData) - Call
IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData) - Applies
AnsiSqlKeywords.sql2003()as reserved words - Applies the
Dialect.sqlKeywordscollected here as reserved words - Applies the Dialect's
NameQualifierSupport, if it defines one
- Overrides:
buildIdentifierHelperin classMySQLDialect- Parameters:
builder- A partially-configuredIdentifierHelperBuilder.metadata- Access to the metadata returned from the driver if needed and if available. WARNING: it may benull.- Returns:
- The
IdentifierHelperinstance to use, ornullto indicate Hibernate should use its fallback path - Throws:
SQLException- Accessing theDatabaseMetaDatacan throw it. Just rethrow and Hibernate will handle it.- See Also:
-
getDual
Description copied from class:DialectReturns a table expression that has one row.- Overrides:
getDualin classMySQLDialect- Returns:
- the SQL equivalent to Oracle's
dual.
-
getViolatedConstraintNameExtractor
Description copied from class:DialectAViolatedConstraintNameExtractorfor extracting the name of a violated constraint from aSQLException.- Specified by:
getViolatedConstraintNameExtractorin interfaceConversionContext- Overrides:
getViolatedConstraintNameExtractorin classMySQLDialect
-
buildSQLExceptionConversionDelegate
Description copied from class:DialectAn instance ofSQLExceptionConversionDelegatefor interpreting dialect-specific error or SQLState codes.If this method is overridden to return a non-null value, the default
SQLExceptionConverterwill use the returnedSQLExceptionConversionDelegatein addition to the following standard delegates:- a "static" delegate based on the JDBC4-defined
SQLExceptionhierarchy, and - a delegate that interprets SQLState codes as either X/Open or SQL-2003 codes, depending on what is reported by the JDBC driver.
It is strongly recommended that every
Dialectimplementation override this method, since interpretation of a SQL error is much more accurate when based on the vendor-specific error code, rather than on the SQLState.- Overrides:
buildSQLExceptionConversionDelegatein classMySQLDialect- Returns:
- The
SQLExceptionConversionDelegatefor this dialect
- a "static" delegate based on the JDBC4-defined
-
equivalentTypes
public boolean equivalentTypes(int typeCode1, int typeCode2) Description copied from class:DialectDo the given JDBC type codes, as defined inTypesrepresent essentially the same type in this dialect of SQL?The default implementation treats
NUMERICandDECIMALas the same type, andFLOAT,REAL, andDOUBLEas essentially the same type, since the ANSI SQL specification fails to meaningfully distinguish them.The default implementation also treats
VARCHAR,NVARCHAR,LONGVARCHAR, andLONGNVARCHARas the same type, andBINARYandLONGVARBINARYas the same type, since Hibernate doesn't really differentiate these types.On the other hand, integral types are not treated as equivalent, instead,
Dialect.isCompatibleIntegralType(int, int)is responsible for determining if the types are compatible.- Overrides:
equivalentTypesin classDialect- Parameters:
typeCode1- the first column type infotypeCode2- the second column type info- Returns:
trueif the two type codes are equivalent
-
supportsIntersect
public boolean supportsIntersect()- Overrides:
supportsIntersectin classMySQLDialect
-
supportsWithClauseInSubquery
public boolean supportsWithClauseInSubquery()Description copied from class:DialectWhether the SQL with clause is supported within a subquery.- Overrides:
supportsWithClauseInSubqueryin classDialect
-
createOptionalTableUpdateOperation
public MutationOperation createOptionalTableUpdateOperation(EntityMutationTarget mutationTarget, OptionalTableUpdate optionalTableUpdate, SessionFactoryImplementor factory) Description copied from class:DialectCreate aMutationOperationfor a updating an optional table- Overrides:
createOptionalTableUpdateOperationin classMySQLDialect
-