Class MariaDBDialect

All Implemented Interfaces:
CheckConstraintSupport, ForeignKeySupport, IdentifierSupport, KeywordSupport, LiteralSupport, AlterTableSupport, ColumnDefinitionSupport, ConstraintControlSupport, IndexDdlSupport, TableCreationSupport, TruncateSupport, CurrentTemporalSupport, TemporalFormatSupport, TemporalOperationSupport, ConversionContext

public class MariaDBDialect extends MySQLDialect
A SQL dialect for MariaDB 10.6 and above.
  • Constructor Details

  • Method Details

    • getMySQLVersion

      public DatabaseVersion getMySQLVersion()
      Overrides:
      getMySQLVersion in class MySQLDialect
    • getMinimumSupportedVersion

      @SPI({IMPLEMENT,SUPPLY}) protected DatabaseVersion getMinimumSupportedVersion()
      Description copied from class: Dialect
      Get 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:
      getMinimumSupportedVersion in class MySQLDialect
    • getNationalizationSupport

      @SPI({IMPLEMENT,SUPPLY}) public NationalizationSupport getNationalizationSupport()
      Description copied from class: Dialect

      Describe 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:
      getNationalizationSupport in class Dialect
      Returns:
      the database nationalization profile
      See Also:
    • initializeFunctionRegistry

      @SPI({IMPLEMENT,SUPPLY}) public void initializeFunctionRegistry(FunctionContributions functionContributions)
      Description copied from class: Dialect

      Contribute the database-specific function descriptors after independent function contributors have run.

      Override this callback to extend or replace the inherited function set. Invoke super first 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 independent FunctionContributor instead when the contribution is not owned by a Dialect.

      Overrides:
      initializeFunctionRegistry in class MySQLDialect
      Parameters:
      functionContributions - the Hibernate-supplied function contribution target
      See Also:
    • castType

      protected String castType(int sqlTypeCode)
      Description copied from class: Dialect

      Return 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:
      castType in class MySQLDialect
    • registerColumnTypes

      @SPI({IMPLEMENT,SUPPLY}) protected void registerColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
      Description copied from class: Dialect

      Register the inherited ANSI-oriented DDL type descriptors during Dialect type contribution.

      Override this focused sub-hook to extend or replace column type registrations. Invoke super first 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 independent TypeContributor instead when the contribution is not owned by a Dialect.

      Overrides:
      registerColumnTypes in class MySQLDialect
      Parameters:
      typeContributions - the Hibernate-supplied contribution target
      serviceRegistry - the Hibernate-supplied bootstrap services
      See Also:
    • getAggregateSupport

      @SPI({IMPLEMENT,SUPPLY}) public AggregateSupport getAggregateSupport()
      Description copied from class: Dialect
      Supply the aggregate-column mapping, DDL, read, assignment, and write behavior for this dialect. Override this method to return a provider implementation of AggregateSupport, or retain the standard behavior returned by the default.
      Overrides:
      getAggregateSupport in class MySQLDialect
      Returns:
      this dialect's aggregate support
      See Also:
    • acceptsJdbcKeyword

      @SPI(IMPLEMENT) public boolean acceptsJdbcKeyword(String word)
      Description copied from interface: KeywordSupport
      Decide 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: Dialect

      Resolve the non-null JDBC descriptor for result-set metadata.

      Preserve vendor replacement and array-component resolution, and delegate unmatched codes to jdbcTypeRegistry.

      Overrides:
      resolveSqlTypeDescriptor in class MySQLDialect
    • contributeTypes

      @SPI({IMPLEMENT,SUPPLY}) public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
      Description copied from class: Dialect

      Contribute 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 super first unless the Dialect intentionally replaces the complete inherited contribution protocol. Obtain reusable dialect-specific JDBC descriptors from the family facades in org.hibernate.dialect.type.spi, and preserve whether a descriptor replaces an existing registration or is added only when absent.

      Overrides:
      contributeTypes in class MySQLDialect
      Parameters:
      typeContributions - the Hibernate-supplied contribution registry
      serviceRegistry -

      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 TypeContributor instead when the contribution is not owned by a Dialect.

    • castPattern

      @SPI({USE,IMPLEMENT}) public String castPattern(CastType from, CastType to)
      Description copied from class: Dialect
      Obtain a pattern for the SQL equivalent to a cast() function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.
      Overrides:
      castPattern in class MySQLDialect
      Parameters:
      from - a CastType indicating the type of the value argument
      to - a CastType indicating the type the value argument is cast to
    • getSqlAstTranslatorFactory

      @SPI({IMPLEMENT,SUPPLY}) public SqlAstTranslatorFactory getSqlAstTranslatorFactory()
      Description copied from class: Dialect

      Supply the factory for this Dialect's single-use SQL AST translators.

      Return null to use StandardSqlAstTranslatorFactory. A custom Dialect should normally return a reusable factory derived from that class and create translators derived from AbstractSqlAstTranslator or an appropriate supported family base. The factory must not retain translation requests, and every translator it returns is used for one translation.

      Overrides:
      getSqlAstTranslatorFactory in class MySQLDialect
      See Also:
    • getWindowFunctionSupport

      public WindowFunctionSupport getWindowFunctionSupport()
      Description copied from class: Dialect

      Supplies 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:
      getWindowFunctionSupport in class MySQLDialect
      Returns:
      this Dialect's stable window-function-support profile
    • getSubquerySupport

      public SubquerySupport getSubquerySupport()
      Description copied from class: Dialect

      Supplies 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 exists predicates in the select list are separate capabilities. Lateral spelling and fallback rendering remain translator responsibilities. When refining a family Dialect, start from SubquerySupport.builder(super.getSubquerySupport()) and change only the differing placements.

      Overrides:
      getSubquerySupport in class MySQLDialect
      Returns:
      this Dialect's stable subquery-support profile
    • getCteSupport

      public CteSupport getCteSupport()
      Description copied from class: Dialect

      The 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; invoking super is 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:
      getCteSupport in class MySQLDialect
    • supports

      @SPI({USE,IMPLEMENT}) public boolean supports(CheckConstraintPlacement placement)
      Specified by:
      supports in interface CheckConstraintSupport
      Overrides:
      supports in class MySQLDialect
    • getTemporalValueSemantics

      @SPI({IMPLEMENT,SUPPLY}) public TemporalValueSemantics getTemporalValueSemantics()
      Description copied from class: Dialect
      Supply temporal precision-adjustment and literal-offset semantics. Return one stable, non-null immutable profile.
      Overrides:
      getTemporalValueSemantics in class MySQLDialect
      See Also:
    • getIfExistsSupport

      @SPI({IMPLEMENT,SUPPLY}) public IfExistsSupport getIfExistsSupport()
      Description copied from class: Dialect

      Supply existence-check placement for schema DDL targets.

      Return one immutable profile for this Dialect's lifetime.

      Overrides:
      getIfExistsSupport in class MySQLDialect
      See Also:
    • getSequenceSupport

      @SPI({IMPLEMENT,SUPPLY}) public SequenceSupport getSequenceSupport()
      Description copied from class: MySQLDialect
      No support for sequences.
      Overrides:
      getSequenceSupport in class MySQLDialect
      Returns:
      the non-null sequence-support strategy
      See Also:
    • getSequenceInformationExtractor

      public SequenceInformationExtractor getSequenceInformationExtractor()
      Description copied from class: Dialect

      Supply 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 with SequenceInformationExtractors.builder(String), and implement SequenceInformationExtractor directly only for a genuinely multi-stage algorithm.

      Overrides:
      getSequenceInformationExtractor in class Dialect
      See Also:
    • getLockingSupport

      public LockingSupport getLockingSupport()
      Description copied from class: Dialect

      Supplies 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:
      getLockingSupport in class MySQLDialect
      See Also:
    • supportsAliasLocks

      protected boolean supportsAliasLocks()
      Overrides:
      supportsAliasLocks in class MySQLDialect
    • supportsForShare

      protected boolean supportsForShare()
      Overrides:
      supportsForShare in class MySQLDialect
    • getGeneratedValuesSupport

      public GeneratedValuesSupport getGeneratedValuesSupport()
      Description copied from class: Dialect

      Supply 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:
      getGeneratedValuesSupport in class Dialect
      Returns:
      true for 10.6 and above because Maria supports insert ... returning even though MySQL does not
    • getIdentityColumnSupport

      public IdentityColumnSupport getIdentityColumnSupport()
      Description copied from class: Dialect

      Supply 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 extending IdentityColumnSupportBase and return the same immutable or otherwise stable support instance on every invocation. Do not construct Hibernate mutation delegates in this supply point.

      Overrides:
      getIdentityColumnSupport in class MySQLDialect
    • getFunctionalDependencyAnalysisSupport

      @SPI({IMPLEMENT,SUPPLY}) public FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport()
      Description copied from class: Dialect

      The database's support for recognizing primary-key functional dependency in group by and order by clauses.

      This profile controls when Hibernate may omit functionally dependent columns. Report only behavior guaranteed by the database across the Dialect's supported versions.

      Overrides:
      getFunctionalDependencyAnalysisSupport in class MySQLDialect
      Returns:
      a non-null immutable capability profile
      See Also:
    • buildIdentifierHelper

      @SPI({USE,IMPLEMENT,SUPPLY}) public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuildRequest request)
      Description copied from interface: IdentifierSupport

      Build 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:
      buildIdentifierHelper in interface IdentifierSupport
      Overrides:
      buildIdentifierHelper in class MySQLDialect
      See Also:
    • getViolatedConstraintNameExtractor

      @SPI({IMPLEMENT,SUPPLY}) public ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor()
      Description copied from class: Dialect

      Supplies the extractor used to recover violated constraint names from database exceptions.

      The extractor returns null when a name cannot be recovered. Do not use an empty string or sentinel to represent absence.

      Specified by:
      getViolatedConstraintNameExtractor in interface ConversionContext
      Overrides:
      getViolatedConstraintNameExtractor in class MySQLDialect
      Returns:
      the non-null constraint-name extractor
      See Also:
    • buildSQLExceptionConversionDelegate

      @SPI({IMPLEMENT,SUPPLY}) public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
      Description copied from class: Dialect

      Supplies 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 null result means that it declined the exception so conversion may continue. Return null from this method when the Dialect has no vendor-specific delegate.

      Prefer stable vendor error codes or SQL states and preserve the original SQLException.

      Overrides:
      buildSQLExceptionConversionDelegate in class MySQLDialect
      Returns:
      the vendor conversion delegate, or null when none is supplied
      See Also:
    • equivalentTypes

      @SPI({USE,IMPLEMENT}) public boolean equivalentTypes(int typeCode1, int typeCode2)
      Description copied from class: Dialect

      Determine 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:
      equivalentTypes in class Dialect
    • getSetOperationSupport

      public SetOperationSupport getSetOperationSupport()
      Description copied from class: Dialect

      Supplies 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 SetOperator independently; support for a distinct operator never implies its ALL form. Structural capabilities such as UNION placement in subqueries are separate from operator support. Continue to override Dialect.getSetOperatorSqlString(SetOperator) when an operator requires database-specific spelling. When refining a family Dialect, start from SetOperationSupport.builder(super.getSetOperationSupport()) and change only the differing values.

      Overrides:
      getSetOperationSupport in class MySQLDialect
      Returns:
      this Dialect's stable set-operation profile
    • createOptionalTableUpdateOperation

      @SPI({USE,IMPLEMENT,SUPPLY}) public MutationOperation createOptionalTableUpdateOperation(OptionalTableUpdateOperationRequest request)
      Description copied from class: Dialect

      Creates 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:
      createOptionalTableUpdateOperation in class MySQLDialect
      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:
      appendDefinition in interface ColumnDefinitionSupport
      Overrides:
      appendDefinition in class MySQLDialect
    • getTemporalTableSupport

      @SPI({IMPLEMENT,SUPPLY}) public TemporalTableSupport getTemporalTableSupport()
      Description copied from class: Dialect

      Supplies 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:
      getTemporalTableSupport in class MySQLDialect
      Returns:
      the non-null temporal-table support strategy
      See Also: