Class MariaDBDialect
- All Implemented Interfaces:
CheckConstraintSupport, ForeignKeySupport, IdentifierSupport, KeywordSupport, LiteralSupport, AlterTableSupport, ColumnDefinitionSupport, ConstraintControlSupport, IndexDdlSupport, TableCreationSupport, TruncateSupport, CurrentTemporalSupport, TemporalFormatSupport, TemporalOperationSupport, ConversionContext
-
Field Summary
Fields inherited from class Dialect
LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGYFields inherited from interface ConstraintControlSupport
NONEFields inherited from interface TruncateSupport
STANDARD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsJdbcKeyword(String word) Decide whether a normalized driver-reported word is truly a keyword for this database.voidappendDefinition(SqlAppender appender, ColumnDefinitionRequest request) Build and supply the configured identifier helper from the stable JDBC metadata snapshot and selected keyword strategy.Supplies vendor-specific SQL-exception conversion for this Dialect.castPattern(CastType from, CastType to) Obtain a pattern for the SQL equivalent to acast()function call.protected StringcastType(int sqlTypeCode) Return the complete cast-target type pattern forsqlTypeCode.voidcontributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Contribute database-specific Java, JDBC, DDL, and basic type descriptors.Creates the JDBC mutation operation for an optional-table update.booleanequivalentTypes(int typeCode1, int typeCode2) Determine directional compatibility of two JDBC or extended SQL type codes.Supply the aggregate-column mapping, DDL, read, assignment, and write behavior for this dialect.The common-table-expression capabilities of this Dialect.The database's support for recognizing primary-key functional dependency ingroup byandorder byclauses.Supply the stable profile describing immediate retrieval of arbitrary database-generated values for this Dialect.Supply the stable identity-column DDL, insert syntax, and identity-specific retrieval behavior for this Dialect.Supply existence-check placement for schema DDL targets.Supplies the cohesive pessimistic-locking profile for this Dialect.protected DatabaseVersionGet the version of the SQL dialect that is the minimum supported by this implementation.Describe how this database represents nationalized character data.Supply the strategy Hibernate uses to discover existing database sequences and their metadata.No support for sequences.Supplies the database's set operators and structural query-group capabilities.Supply the factory for this Dialect's single-use SQL AST translators.Supplies the database's supported subquery placements.Supplies the complete temporal-table DDL and historical-query strategy for this Dialect.Supply temporal precision-adjustment and literal-offset semantics.Supplies the extractor used to recover violated constraint names from database exceptions.Supplies the native window-function syntax supported by this database.voidinitializeFunctionRegistry(FunctionContributions functionContributions) Contribute the database-specific function descriptors after independent function contributors have run.protected voidregisterColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Register the inherited ANSI-oriented DDL type descriptors during Dialect type contribution.resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Resolve the non-null JDBC descriptor for result-set metadata.booleansupports(CheckConstraintPlacement placement) protected booleanprotected booleanMethods inherited from class MySQLDialect
addPartitionKeyToPrimaryKey, alterColumnType, appendBooleanValueString, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendFormat, appendLiteral, causesRollback, closeQuote, columnType, constraintControlMode, contributeKeywords, createVersion, currentTimestamp, datetimeFormat, disableCommands, enableCommands, extractPattern, fractionalSecondPrecisionInNanos, getCurrentTemporalSupport, getCurrentTimestampSelection, getDefaultMySQLStorageEngine, getDirectJavaTimeJdbcSupport, getDmlTargetColumnQualifierSupport, getEnumSupport, getInformationExtractor, getLimitHandler, getLobSupport, getLocalTemporaryTableStrategy, getMaxAliasLength, getMaxIdentifierLength, getMaximumSeriesSize, getMultiTableMutationSupport, getMutationSyntaxSupport, getNameQualifierSupport, getNamespaceSupport, getNullOrderingSupport, getObjectNullBindingStrategy, getPredicateSupport, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getRowValueSupport, getSchemaCommentSupport, getSchemaDropSupport, getSingleRowTableSupport, getSizeStrategy, getStringValueSemantics, getTemporalFormatSupport, getTemporalOperationSupport, getTypeSizingProfile, getUniqueDelegate, isJdbcLogWarningsEnabledByDefault, isNoBackslashEscapesEnabled, nameQualification, openQuote, registerJsonFunctions, render, renderAddConstraint, renderDropConstraint, requiresSelfReferentialForeignKeyNullification, resolveSqlTypeLength, supportsOnDeleteAction, tableCreationOptions, timestampaddPattern, timestampdiffPatternMethods inherited from class Dialect
appendArrayLiteral, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildLockingClauseStrategy, buildStringToBooleanCast, buildStringToBooleanCastDecode, contributeDefaultProperties, defaultScrollMode, determineDatabaseVersion, getAlterTableSupport, getArraySupport, getArrayTypeName, getBatchLoadSizingStrategy, getCallableStatementSupport, getCatalogSeparator, getCheckConstraintSupport, getColumnAliasExtractor, getColumnDefinitionSupport, getConstraintControlSupport, getDefaultOrdinalityColumnName, getDefaultProperties, getEntityLockingStrategyFactory, getExpressionCoercionSupport, getFetchClauseSupport, getForeignKeyExporter, getForeignKeySupport, getGlobalTemporaryTableStrategy, getIdentifierSupport, getIndexDdlSupport, getIndexExporter, getJdbcMetadataOverrides, getKeywords, getKeywordSupport, getLiteralSupport, getLobMergeStrategy, getLockingClauseStrategy, getLowercaseFunction, getMultiKeyLoadSizingStrategy, getNativeParameterMarkerStrategy, getNativeValueGenerationStrategy, getParameterLimits, getPersistentTemporaryTableStrategy, getQueryHintPlacement, getQueryHintString, getRefCursorSupportFactory, getRowIdSupport, getRowLevelSecurity, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSetOperatorSqlString, getSyntheticTableGroupSupport, getTableCleaner, getTableCreationSupport, getTableExporter, getTableMigrator, getTemporaryTableExporter, getTimeZoneSupport, getTruncateSupport, getTupleCountSupport, getUserDefinedTypeExporter, getValuesListSupport, getVersion, narrowCastType, resolveSqlTypeCode, resolveSqlTypeCode, supportsCrossJoin, supportsFilterClause, supportsNationalizedMethods, supportsOrdinalSelectItemReference, supportsUserDefinedTypes, throttleDdl, toString, trimPattern, truncateModeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AlterTableSupport
addColumnPrefix, addColumnSuffix, alterTableCommandMethods inherited from interface ConstraintControlSupport
disableConstraintCommands, enableConstraintCommandsMethods inherited from interface CurrentTemporalSupport
currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestampWithTimeZone, isCurrentTimestampStable, usesStandardCurrentTimestampFunctionMethods inherited from interface ForeignKeySupport
supportsAlterTableConstraintsMethods inherited from interface IdentifierSupport
quote, quoteCollation, toQuotedIdentifierMethods inherited from interface IndexDdlSupport
createCommand, createTailMethods inherited from interface LiteralSupport
appendBinaryLiteral, appendIntervalLiteral, appendIntervalLiteral, appendUUIDLiteral, toBooleanValueStringMethods inherited from interface TableCreationSupport
createTableCommand, requiresViewColumnListMethods inherited from interface TemporalOperationSupport
translateDurationField, translateExtractFieldMethods inherited from interface TruncateSupport
renderCommands
-
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.This method is called during superclass construction. Implementations must return construction-safe immutable data and must not depend on subclass initialization.
- Overrides:
getMinimumSupportedVersionin classMySQLDialect
-
getNationalizationSupport
Description copied from class:DialectDescribe how this database represents nationalized character data.
This database SQL-type capability is independent of whether the JDBC driver correctly implements nationalized access methods. Override
Dialect.supportsNationalizedMethods()separately when the driver cannot use those methods.- Overrides:
getNationalizationSupportin classDialect- Returns:
- the database nationalization profile
- See Also:
-
initializeFunctionRegistry
@SPI({IMPLEMENT,SUPPLY}) public void initializeFunctionRegistry(FunctionContributions functionContributions) Description copied from class:DialectContribute the database-specific function descriptors after independent function contributors have run.
Override this callback to extend or replace the inherited function set. Invoke
superfirst to retain Hibernate's standard and emulated registrations; omitting it deliberately replaces that set. Mutate the supplied boot-scoped function registry only during this callback, and do not retain the contribution context or registry afterward. Implement an independentFunctionContributorinstead when the contribution is not owned by a Dialect.- Overrides:
initializeFunctionRegistryin classMySQLDialect- Parameters:
functionContributions- the Hibernate-supplied function contribution target- See Also:
-
castType
Description copied from class:DialectReturn the complete cast-target type pattern for
sqlTypeCode.Override this hook when cast syntax differs from column declaration syntax; otherwise delegate to
Dialect.columnType(int).- Overrides:
castTypein classMySQLDialect
-
registerColumnTypes
@SPI({IMPLEMENT,SUPPLY}) protected void registerColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Description copied from class:DialectRegister the inherited ANSI-oriented DDL type descriptors during Dialect type contribution.
Override this focused sub-hook to extend or replace column type registrations. Invoke
superfirst to retain the inherited descriptor set; omitting it deliberately replaces that set. Mutate the supplied boot-scoped registry only during this callback, and do not retain the contribution context or registry afterward. Implement an independentTypeContributorinstead when the contribution is not owned by a Dialect.- Overrides:
registerColumnTypesin classMySQLDialect- Parameters:
typeContributions- the Hibernate-supplied contribution targetserviceRegistry- the Hibernate-supplied bootstrap services- See Also:
-
getAggregateSupport
Description copied from class:DialectSupply the aggregate-column mapping, DDL, read, assignment, and write behavior for this dialect. Override this method to return a provider implementation ofAggregateSupport, or retain the standard behavior returned by the default.- Overrides:
getAggregateSupportin classMySQLDialect- Returns:
- this dialect's aggregate support
- See Also:
-
acceptsJdbcKeyword
Description copied from interface:KeywordSupportDecide whether a normalized driver-reported word is truly a keyword for this database. -
resolveSqlTypeDescriptor
@SPI({USE,IMPLEMENT}) public JdbcType resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Description copied from class:DialectResolve the non-null JDBC descriptor for result-set metadata.
Preserve vendor replacement and array-component resolution, and delegate unmatched codes to
jdbcTypeRegistry.- Overrides:
resolveSqlTypeDescriptorin classMySQLDialect
-
contributeTypes
@SPI({IMPLEMENT,SUPPLY}) public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Description copied from class:DialectContribute database-specific Java, JDBC, DDL, and basic type descriptors.
Override this method when the database or JDBC driver requires descriptors beyond the inherited registrations. Invoke
superfirst unless the Dialect intentionally replaces the complete inherited contribution protocol. Obtain reusable dialect-specific JDBC descriptors from the family facades inorg.hibernate.dialect.type.spi, and preserve whether a descriptor replaces an existing registration or is added only when absent.- Overrides:
contributeTypesin classMySQLDialect- Parameters:
typeContributions- the Hibernate-supplied contribution registryserviceRegistry-the Hibernate-supplied services, including class loading used by driver-backed descriptor factories
Mutate the supplied boot-scoped registries only during this callback and do not retain the contribution context or a mutable registry afterward. Implement an independent
TypeContributorinstead when the contribution is not owned by a Dialect.
-
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:DialectSupply the factory for this Dialect's single-use SQL AST translators.
Return
nullto useStandardSqlAstTranslatorFactory. A custom Dialect should normally return a reusable factory derived from that class and create translators derived fromAbstractSqlAstTranslatoror an appropriate supported family base. The factory must not retain translation requests, and every translator it returns is used for one translation.- Overrides:
getSqlAstTranslatorFactoryin classMySQLDialect- See Also:
-
getWindowFunctionSupport
Description copied from class:DialectSupplies the native window-function syntax supported by this database.
Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Baseline window calls, window partitioning, each frame unit, and frame exclusion are independent grammar facts. Every refinement requires baseline window support, and frame exclusion additionally requires a supported frame unit. Function-specific restrictions and individual frame-bound restrictions remain the responsibility of focused rendering.
When refining a family Dialect, start from
WindowFunctionSupport.builder(super.getWindowFunctionSupport())and change only the differing features.- Overrides:
getWindowFunctionSupportin classMySQLDialect- Returns:
- this Dialect's stable window-function-support profile
-
getSubquerySupport
Description copied from class:DialectSupplies the database's supported subquery placements.
Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Declare every placement independently. In particular, scalar subqueries in the select list and
existspredicates in the select list are separate capabilities. Lateral spelling and fallback rendering remain translator responsibilities. When refining a family Dialect, start fromSubquerySupport.builder(super.getSubquerySupport())and change only the differing placements.- Overrides:
getSubquerySupportin classMySQLDialect- Returns:
- this Dialect's stable subquery-support profile
-
getCteSupport
Description copied from class:DialectThe common-table-expression capabilities of this Dialect.
The returned immutable profile must be non-null and stable for the lifetime of this Dialect. Hibernate may cache and reuse it. Overrides may construct a new profile or copy
CteSupport.STANDARD; invokingsuperis not required. This method is called only after Dialect construction, has no corresponding shutdown lifecycle, and failures propagate to the operation which obtains the profile.- Overrides:
getCteSupportin classMySQLDialect
-
supports
- Specified by:
supportsin interfaceCheckConstraintSupport- Overrides:
supportsin classMySQLDialect
-
getTemporalValueSemantics
Description copied from class:DialectSupply temporal precision-adjustment and literal-offset semantics. Return one stable, non-null immutable profile.- Overrides:
getTemporalValueSemanticsin classMySQLDialect- See Also:
-
getIfExistsSupport
Description copied from class:DialectSupply existence-check placement for schema DDL targets.
Return one immutable profile for this Dialect's lifetime.
- Overrides:
getIfExistsSupportin classMySQLDialect- See Also:
-
getSequenceSupport
Description copied from class:MySQLDialectNo support for sequences.- Overrides:
getSequenceSupportin classMySQLDialect- Returns:
- the non-null sequence-support strategy
- See Also:
-
getSequenceInformationExtractor
Description copied from class:DialectSupply the strategy Hibernate uses to discover existing database sequences and their metadata.
Return
SequenceInformationExtractors.none()when the database version does not expose sequence metadata. Configure ordinary single-query extraction withSequenceInformationExtractors.builder(String), and implementSequenceInformationExtractordirectly only for a genuinely multi-stage algorithm.- Overrides:
getSequenceInformationExtractorin classDialect- See Also:
-
getLockingSupport
Description copied from class:DialectSupplies the cohesive pessimistic-locking profile for this Dialect.
The profile coordinates capability metadata, statement-clause rendering, table hints, already-rendered SQL rewriting, connection timeout handling, and follow-on locking. A custom Dialect should supply one internally consistent profile instead of overriding those behaviors independently. The returned support must be non-null and stable for the Dialect lifetime; its components may be reused concurrently and must not retain per-query requests.
- Overrides:
getLockingSupportin classMySQLDialect- See Also:
-
supportsAliasLocks
protected boolean supportsAliasLocks()- Overrides:
supportsAliasLocksin classMySQLDialect
-
getGeneratedValuesSupport
Description copied from class:DialectSupply the stable profile describing immediate retrieval of arbitrary database-generated values for this Dialect.
Override this method to declare native insert or update returning, row-id returning, or JDBC generated-key support for arbitrary generated columns. Identity-only retrieval belongs to
Dialect.getIdentityColumnSupport(), and an ordinary select after mutation is a Hibernate fallback rather than a capability of this profile. Refine a family profile by copying the value returned by the superclass and changing only the differing capabilities.- Overrides:
getGeneratedValuesSupportin classDialect- Returns:
truefor 10.6 and above because Maria supportsinsert ... returningeven though MySQL does not
-
getIdentityColumnSupport
Description copied from class:DialectSupply the stable identity-column DDL, insert syntax, and identity-specific retrieval behavior for this Dialect.
Override this method to supply a provider implementation of
IdentityColumnSupport. Prefer extendingIdentityColumnSupportBaseand return the same immutable or otherwise stable support instance on every invocation. Do not construct Hibernate mutation delegates in this supply point.- Overrides:
getIdentityColumnSupportin classMySQLDialect
-
getFunctionalDependencyAnalysisSupport
@SPI({IMPLEMENT,SUPPLY}) public FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport()Description copied from class:DialectThe database's support for recognizing primary-key functional dependency in
group byandorder byclauses.This profile controls when Hibernate may omit functionally dependent columns. Report only behavior guaranteed by the database across the Dialect's supported versions.
- Overrides:
getFunctionalDependencyAnalysisSupportin classMySQLDialect- Returns:
- a non-null immutable capability profile
- See Also:
-
buildIdentifierHelper
@SPI({USE,IMPLEMENT,SUPPLY}) public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuildRequest request) Description copied from interface:IdentifierSupportBuild and supply the configured identifier helper from the stable JDBC metadata snapshot and selected keyword strategy.
This inherited implementation initializes identifier casing, keywords, and namespace support from the request. Invoke it before replacing any of those values with authoritative provider settings, then build the final helper from the same builder. Settings which this implementation does not initialize may be applied before invoking it. If builder configuration cannot express a database rule, decorate the final helper with
DelegatingIdentifierHelper. Do not retain the request, builder, or metadata view.- Specified by:
buildIdentifierHelperin interfaceIdentifierSupport- Overrides:
buildIdentifierHelperin classMySQLDialect- See Also:
-
getViolatedConstraintNameExtractor
@SPI({IMPLEMENT,SUPPLY}) public ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor()Description copied from class:DialectSupplies the extractor used to recover violated constraint names from database exceptions.
The extractor returns
nullwhen a name cannot be recovered. Do not use an empty string or sentinel to represent absence.- Specified by:
getViolatedConstraintNameExtractorin interfaceConversionContext- Overrides:
getViolatedConstraintNameExtractorin classMySQLDialect- Returns:
- the non-null constraint-name extractor
- See Also:
-
buildSQLExceptionConversionDelegate
@SPI({IMPLEMENT,SUPPLY}) public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()Description copied from class:DialectSupplies vendor-specific SQL-exception conversion for this Dialect.
The returned delegate runs in addition to Hibernate's standard JDBC exception-hierarchy and SQL-state delegates. Its
nullresult means that it declined the exception so conversion may continue. Returnnullfrom this method when the Dialect has no vendor-specific delegate.Prefer stable vendor error codes or SQL states and preserve the original
SQLException.- Overrides:
buildSQLExceptionConversionDelegatein classMySQLDialect- Returns:
- the vendor conversion delegate, or
nullwhen none is supplied - See Also:
-
equivalentTypes
Description copied from class:DialectDetermine directional compatibility of two JDBC or extended SQL type codes.
Preserve widening integral compatibility and enum-to-character compatibility as directional relationships; accepting
(a,b)does not imply that(b,a)is accepted. Provider overrides should delegate unmatched pairs.- Overrides:
equivalentTypesin classDialect
-
getSetOperationSupport
Description copied from class:DialectSupplies the database's set operators and structural query-group capabilities.
Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Declare each
SetOperatorindependently; support for a distinct operator never implies itsALLform. Structural capabilities such asUNIONplacement in subqueries are separate from operator support. Continue to overrideDialect.getSetOperatorSqlString(SetOperator)when an operator requires database-specific spelling. When refining a family Dialect, start fromSetOperationSupport.builder(super.getSetOperationSupport())and change only the differing values.- Overrides:
getSetOperationSupportin classMySQLDialect- Returns:
- this Dialect's stable set-operation profile
-
createOptionalTableUpdateOperation
@SPI({USE,IMPLEMENT,SUPPLY}) public MutationOperation createOptionalTableUpdateOperation(OptionalTableUpdateOperationRequest request) Description copied from class:DialectCreates the JDBC mutation operation for an optional-table update.
Override this factory when the database needs an operation other than the standard update-then-insert behavior. The request contains the semantic update and bootstrap services; implementations must return an operation for the same
OptionalTableUpdateOperationRequest.mutationTarget()and must not retain the request.- Overrides:
createOptionalTableUpdateOperationin classMySQLDialect- Returns:
- a non-null operation for the supplied optional-table update
- See Also:
-
appendDefinition
@SPI({USE,IMPLEMENT}) public void appendDefinition(SqlAppender appender, ColumnDefinitionRequest request) - Specified by:
appendDefinitionin interfaceColumnDefinitionSupport- Overrides:
appendDefinitionin classMySQLDialect
-
getTemporalTableSupport
Description copied from class:DialectSupplies the complete temporal-table DDL and historical-query strategy for this Dialect.
Return an immutable strategy and use the supported request values without retaining them. Prefer
TemporalTableSupports.standard(int, int, boolean)when only the column type, precision, and table-check capability differ.- Overrides:
getTemporalTableSupportin classMySQLDialect- Returns:
- the non-null temporal-table support strategy
- See Also:
-