Class Dialect

java.lang.Object
org.hibernate.dialect.Dialect
All Implemented Interfaces:
CheckConstraintSupport, ForeignKeySupport, IdentifierSupport, KeywordSupport, LiteralSupport, AlterTableSupport, ColumnDefinitionSupport, ConstraintControlSupport, IndexDdlSupport, TableCreationSupport, TruncateSupport, TemporalOperationSupport, ConversionContext
Direct Known Subclasses:
AbstractTransactSQLDialect, CockroachDialect, DB2Dialect, GenericDialect, H2Dialect, HANADialect, HSQLDialect, MySQLDialect, OracleDialect, PostgreSQLDialect, SpannerDialect

Represents a dialect of SQL implemented by a particular RDBMS. Every subclass of this class implements support for a certain database platform. For example, PostgreSQLDialect implements support for PostgreSQL, and MySQLDialect implements support for MySQL.

A subclass must provide a public constructor with a single parameter of type DialectResolutionInfo. Alternatively, for purposes of backward compatibility with older versions of Hibernate, a constructor with no parameters is also allowed.

Almost every subclass must, as a bare minimum, override at least:

A subclass representing a dialect of SQL which deviates significantly from ANSI SQL will certainly override many additional operations.

Subclasses should be thread-safe and immutable.

Since Hibernate 6, a single subclass of Dialect represents all releases of a given product-specific SQL dialect. The version of the database is exposed at runtime via the DialectResolutionInfo passed to the constructor, and by the getVersion() property.

Programs using Hibernate should migrate away from the use of versioned dialect classes like, for example, MySQL8Dialect. These classes are now deprecated and will be removed in a future release.

A custom Dialect may be specified using the configuration property "hibernate.dialect", but for supported databases this property is unnecessary, and Hibernate will select the correct Dialect based on the JDBC URL and DialectResolutionInfo.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • determineDatabaseVersion

      @SPI({USE,IMPLEMENT}) public DatabaseVersion determineDatabaseVersion(DialectResolutionInfo info)
      Determine the database version, as precise as possible and using Dialect-specific techniques, from a DialectResolutionInfo object.

      This method is called during superclass construction by Dialect(DialectResolutionInfo). Implementations must not depend on subclass initialization. Integration providers may also invoke this method on an existing Dialect when database metadata becomes available after the Dialect was constructed.

      Parameters:
      info - The dialect resolution info that would be passed by Hibernate ORM to the constructor of a Dialect of the same type.
      Returns:
      The corresponding database version.
    • contributeDefaultProperties

      @SPI({USE,IMPLEMENT,SUPPLY}) protected void contributeDefaultProperties(Properties properties)

      Contribute provider configuration defaults after Dialect construction.

      Invoke super first to extend the inherited defaults. Omitting super deliberately replaces them. Mutate the supplied isolated property bag only during this callback; do not retain it or call getDefaultProperties() from a Dialect constructor.

      Parameters:
      properties - the isolated contribution target
      Since:
      8.0
    • registerColumnTypes

      @SPI({USE,IMPLEMENT,SUPPLY}) protected void registerColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)

      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.

      Parameters:
      typeContributions - the Hibernate-supplied contribution target
      serviceRegistry - the Hibernate-supplied bootstrap services
      Since:
      8.0
      See Also:
    • columnType

      @SPI({USE,IMPLEMENT}) protected String columnType(int sqlTypeCode)

      Return the complete database column declaration pattern for a JDBC Types or Hibernate SqlTypes code used during type registration.

      Use only $l, $p, and $s for length, precision, and scale. Define distinct mappings for the LONG32 codes; the JDBC LONG synonyms are normalized before this hook. Delegate unknown inherited codes to the superclass so its standard exception remains authoritative.

    • castType

      @SPI({USE,IMPLEMENT}) protected String castType(int sqlTypeCode)

      Return the complete cast-target type pattern for sqlTypeCode.

      Override this hook when cast syntax differs from column declaration syntax; otherwise delegate to columnType(int).

    • narrowCastType

      @Incubating(since="7.4") @SPI({USE,IMPLEMENT}) protected String narrowCastType(int sqlTypeCode)

      Return the complete type pattern for a cast or set-returning-function declaration position which rejects locator LOB names.

      The standard implementation maps locator and LONG32 LOB codes to the corresponding varying type and delegates every other code to columnType(int).

      Since:
      7.4
    • contributeKeywords

      @SPI({USE,IMPLEMENT,SUPPLY}) protected void contributeKeywords(KeywordRegistration registration)

      Contribute ANSI and database-specific SQL keywords.

      Invoke super first to retain the SQL:2003 words. Omitting super deliberately replaces the inherited keyword profile. Register words only during this callback and do not retain the registration target.

      Parameters:
      registration - the scoped keyword target
      Since:
      8.0
    • getVersion

      @SPI(USE) public final DatabaseVersion getVersion()
      Get the version of the SQL dialect that is the target of this instance.
    • getMinimumSupportedVersion

      @SPI({IMPLEMENT,SUPPLY}) protected DatabaseVersion getMinimumSupportedVersion()
      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.

    • resolveSqlTypeCode

      @SPI({USE,IMPLEMENT}) @Nullable protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration)

      Resolve a database-reported type name before base-name extraction.

      columnTypeName is complete and may include parameters or an array suffix. Return null when it cannot be resolved.

    • resolveSqlTypeCode

      @SPI({USE,IMPLEMENT}) @Nullable protected Integer resolveSqlTypeCode(String typeName, String baseTypeName, TypeConfiguration typeConfiguration)
      Resolve a database-reported type using both its complete and normalized base names. Return null when neither identifies a registered type.
    • resolveSqlTypeDescriptor

      @SPI({USE,IMPLEMENT}) public JdbcType resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry)

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

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

    • resolveSqlTypeLength

      @SPI({USE,IMPLEMENT}) public int resolveSqlTypeLength(String columnTypeName, int jdbcTypeCode, int precision, int scale, int displaySize)

      Normalize JDBC result-set metadata to Hibernate's resolved column length.

      JDBC precision may represent character length. Providers should retain their vendor formulas using all supplied metadata values.

    • getEnumSupport

      @SPI({IMPLEMENT,SUPPLY}) public EnumSupport getEnumSupport()
      Supply the database's finite-domain declaration, lifecycle, and check strategy. Return one stable, thread-safe strategy for this Dialect.
      Returns:
      the non-null enum support strategy
      Since:
      8.0
      See Also:
    • getDirectJavaTimeJdbcSupport

      @SPI({IMPLEMENT,SUPPLY}) public DirectJavaTimeJdbcSupport getDirectJavaTimeJdbcSupport()
      Supply direct JDBC access capabilities for Java Time classes. Return one stable, non-null, thread-safe implementation.
      Returns:
      the direct Java Time JDBC support for this Dialect and driver
      Since:
      8.0
      See Also:
    • initializeFunctionRegistry

      @SPI({USE,IMPLEMENT,SUPPLY}) public void initializeFunctionRegistry(FunctionContributions functionContributions)

      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.

      Parameters:
      functionContributions - the Hibernate-supplied function contribution target
      Since:
      8.0
      See Also:
    • castPattern

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

      @SPI(USE) protected final String buildStringToBooleanCast(String trueValue, String falseValue)

      Build the complete portable string-to-Boolean cast expression using the supplied SQL fragments for the true and false results.

      The accepted input spellings are t, true, y, 1, f, false, n, and 0, compared in lowercase. Null or unrecognized input produces null. Providers should call this final helper from castPattern(CastType, CastType) rather than reproduce its VALUES-list and select/union alternatives.

    • buildStringToBooleanCastDecode

      @SPI(USE) protected final String buildStringToBooleanCastDecode(String trueValue, String falseValue)

      Build the complete string-to-Boolean cast expression using the database decode function and the supplied SQL fragments for true and false.

      The accepted input spellings and null behavior are identical to buildStringToBooleanCast(String, String). Providers should call this final helper from castPattern(CastType, CastType) when decode is the appropriate native rendering.

    • getSingleRowTableSupport

      @SPI({IMPLEMENT,SUPPLY}) public SingleRowTableSupport getSingleRowTableSupport()

      Supply the SQL renderings used for a reusable single-row table and for an otherwise table-less select.

      Override this method with one stable, non-null profile when either rendering differs from SingleRowTableSupport.STANDARD. The table expression and the complete select-only from fragment are independent; an empty fragment means that no from clause is required. Dialect subclasses refining a family profile should copy getSingleRowTableSupport() from the superclass and change only the values which differ.

      Returns:
      the stable, non-null single-row-table-support profile
      Since:
      8.0
    • trimPattern

      @SPI({USE,IMPLEMENT}) public String trimPattern(TrimSpec specification, boolean isWhitespace)
      Obtain a pattern for the SQL equivalent to a trim() function call. The resulting pattern must contain a ?1 placeholder for the argument of type String and a ?2 placeholder for the trim character if isWhitespace was false.
      Parameters:
      specification - leading, trailing, or both
      isWhitespace - true if trimming whitespace, and the ?2 placeholder for the trim character should be omitted, false if the trim character is explicit and the ?2 placeholder must be included in the pattern
    • equivalentTypes

      @SPI({USE,IMPLEMENT}) public boolean equivalentTypes(int typeCode1, int typeCode2)

      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.

    • getDefaultProperties

      public Properties getDefaultProperties()

      Retrieve a defensive copy of the completed configuration defaults.

      This engine bootstrap accessor materializes provider contributions once, after normal Dialect construction. Mutating the returned copy does not affect the Dialect or a later caller.

    • toString

      @SPI(USE) public final String toString()
      Overrides:
      toString in class Object
    • contributeTypes

      @SPI({USE,IMPLEMENT,SUPPLY}) public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)

      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.

      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.

      Since:
      8.0
    • getLobMergeStrategy

      @SPI({IMPLEMENT,SUPPLY}) public LobMergeStrategy getLobMergeStrategy()
    • getNativeValueGenerationStrategy

      @Incubating(since="7.0") @SPI({IMPLEMENT,SUPPLY}) public GenerationType getNativeValueGenerationStrategy()

      Supply the semantic identifier-generation type used for native generation.

      Return a non-null typed value instead of a legacy generator name or implementation class. The inherited implementation selects GenerationType.IDENTITY when this Dialect's IdentityColumnSupport supports identity columns and GenerationType.SEQUENCE otherwise. Override it when the database's native choice differs from that rule.

      Legacy "native" mappings and NativeGenerator consume this same provider decision.

      Returns:
      the non-null semantic native identifier-generation type
      Since:
      7.0
      See Also:
    • getIdentityColumnSupport

      @SPI({IMPLEMENT,SUPPLY}) public IdentityColumnSupport getIdentityColumnSupport()

      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.

      Since:
      8.0
    • getSequenceSupport

      @SPI({USE,IMPLEMENT,SUPPLY}) public SequenceSupport getSequenceSupport()

      Supplies the complete sequence value-expression and lifecycle-DDL strategy for this Dialect.

      Return the same stable, thread-safe strategy for the Dialect's lifetime. Use SequenceSupports.none() when sequences are unsupported, select one of the other stock strategies only when its complete grammar matches the database, or supply a provider implementation of SequenceSupport.

      Returns:
      the non-null sequence-support strategy
      Since:
      8.0
      See Also:
    • getRowLevelSecurity

      @Incubating(since="8.0", group="row-level-security") @SPI({USE,IMPLEMENT,SUPPLY}) public RowLevelSecurity getRowLevelSecurity()

      Supplies the complete database-native row-level-security strategy for this Dialect.

      Return the same stable, thread-safe strategy for the Dialect's lifetime. Use RowLevelSecurityStrategies.none() when native row-level security is unsupported, and return declarative DDL instead of mutating boot metadata.

      Returns:
      the non-null row-level-security strategy
      Since:
      8.0
      See Also:
    • getSequenceInformationExtractor

      @SPI({USE,IMPLEMENT,SUPPLY}) public SequenceInformationExtractor getSequenceInformationExtractor()

      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.

      See Also:
    • getInformationExtractor

      @SPI({IMPLEMENT,SUPPLY}) public InformationExtractor getInformationExtractor(ExtractionContext extractionContext)

      Supply the context-bound strategy Hibernate uses to discover database tables, keys, indexes, and related schema metadata.

      Return a new extractor for extractionContext. Prefer a stock profile from InformationExtractors, and implement InformationExtractor directly only when none of those complete profiles matches the database.

      Since:
      7.2
      See Also:
    • getLimitHandler

      @SPI(SUPPLY) public LimitHandler getLimitHandler()

      Supplies execution-time pagination for already-rendered SQL requested by Query.setMaxResults(int) or Query.setFirstResult(int).

      This is distinct from SQL AST PaginationRenderingSupport, which handles offset and fetch clauses represented in the semantic tree. A custom Dialect should normally return a stock LimitHandler or extend a supported handler family. The returned handler may be reused concurrently and must not retain per-query state.

      Returns:
      a non-null handler
      Throws:
      UnsupportedOperationException - if execution-time pagination is not supported
    • getLockingSupport

      @SPI({IMPLEMENT,SUPPLY}) public LockingSupport getLockingSupport()

      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.

      See Also:
    • getLockingClauseStrategy

      @SPI({USE,IMPLEMENT,SUPPLY}) public LockingClauseStrategy getLockingClauseStrategy(QuerySpec querySpec, LockOptions lockOptions)
      Supplies the per-translation strategy for a statement-level [PessimisticLockStyle#CLAUSE locking clause].
      See Also:
    • buildLockingClauseStrategy

      @SPI({USE,IMPLEMENT,SUPPLY}) protected LockingClauseStrategy buildLockingClauseStrategy(PessimisticLockKind lockKind, RowLockStrategy rowLockStrategy, LockOptions lockOptions, Set<NavigablePath> rootPathsForLocking)
      Builds the per-translation statement-clause strategy after the lock kind, row-targeting strategy, and root paths have been resolved.
      See Also:
    • getEntityLockingStrategyFactory

      @SPI({IMPLEMENT,SUPPLY}) public EntityLockingStrategyFactory getEntityLockingStrategyFactory()

      The stable factory which creates executable entity-locking strategies for this Dialect.

      Override this method to select a stock profile from EntityLockingStrategies or to supply a thread-safe custom factory. The factory must not retain a request or its target, and must return a non-null strategy.

      Since:
      8.0
      See Also:
    • getMultiTableMutationSupport

      @SPI({IMPLEMENT,SUPPLY}) public MultiTableMutationSupport getMultiTableMutationSupport()

      Select the Hibernate-owned fallback families used for SQM update/delete and insert operations targeting entities mapped to multiple tables.

      A custom Dialect should return one of the named profiles when both operation families use the same strategy kind, or construct an asymmetric profile when they differ. Local, global, and persistent-table selections require the corresponding non-null temporary-table strategy, while CTE requires non-query CTE support.

      Configured global and entity-specific custom strategies take precedence over this fallback. Supply a custom execution implementation with QuerySettings.QUERY_MULTI_TABLE_MUTATION_STRATEGY or QuerySettings.QUERY_MULTI_TABLE_INSERT_STRATEGY instead of depending on Hibernate's internal fallback implementations.

      Returns:
      a stable, non-null fallback selection profile
      Since:
      8.0
    • getCatalogSeparator

      @SPI({IMPLEMENT,SUPPLY}) public String getCatalogSeparator()

      Supply the catalog separator used when JDBC metadata is unavailable.

      This is independent of getNameQualifierSupport(). JDBC metadata remains authoritative when it supplies a separator.

      Returns:
      the non-null fallback catalog separator
    • getCurrentTemporalSupport

      @SPI({IMPLEMENT,SUPPLY}) public CurrentTemporalSupport getCurrentTemporalSupport()
      Supply current temporal expressions and database-side timestamp retrieval. Return one stable, non-null, thread-safe implementation. Providers may implement CurrentTemporalSupport directly and return this.
      Since:
      8.0
      See Also:
    • getTemporalFormatSupport

      @SPI({IMPLEMENT,SUPPLY}) public TemporalFormatSupport getTemporalFormatSupport()
      Supply datetime-format translation. Return one stable, non-null, thread-safe implementation.
      Since:
      8.0
      See Also:
    • getTemporalOperationSupport

      @SPI({IMPLEMENT,SUPPLY}) public TemporalOperationSupport getTemporalOperationSupport()
      Supply extraction and timestamp-arithmetic syntax. Return one stable, non-null, thread-safe implementation. Providers may implement TemporalOperationSupport directly and return this.
      Since:
      8.0
      See Also:
    • getTemporalValueSemantics

      @SPI({IMPLEMENT,SUPPLY}) public TemporalValueSemantics getTemporalValueSemantics()
      Supply temporal precision-adjustment and literal-offset semantics. Return one stable, non-null immutable profile.
      Since:
      8.0
      See Also:
    • buildSQLExceptionConversionDelegate

      @SPI({USE,IMPLEMENT,SUPPLY}) @Nullable public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()

      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.

      Returns:
      the vendor conversion delegate, or null when none is supplied
      Since:
      8.0
      See Also:
    • getViolatedConstraintNameExtractor

      @SPI({USE,IMPLEMENT,SUPPLY}) public ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor()

      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
      Returns:
      the non-null constraint-name extractor
      Since:
      8.0
      See Also:
    • getSelectClauseNullString

      @SPI({USE,IMPLEMENT}) public String getSelectClauseNullString(SqlTypedMapping sqlTypeMapping, TypeConfiguration typeConfiguration)

      Render the complete typed-null select-item expression for one arm of a union query.

      Use the complete mapping when the database requires an explicit cast so that named and aggregate types, length, precision, scale, and temporal precision are retained. Return the complete expression, not only a type name. The standard form is the untyped SQL literal null.

      Parameters:
      sqlTypeMapping - the complete mapping of the union select item
      typeConfiguration - the active type configuration
      Returns:
      the complete select-item expression
    • getSetOperatorSqlString

      @SPI({USE,IMPLEMENT}) public String getSetOperatorSqlString(SetOperator operator)
      Get the SQL string representation for a specific set operator (UNION, INTERSECT, EXCEPT).

      The default implementation delegates to SetOperator.sqlString(). Dialects like Cloud Spanner that require explicit 'DISTINCT' keywords can override this.

      Parameters:
      operator - The set operator
      Returns:
      The SQL fragment (e.g., "union", "union all", "union distinct")
    • getLowercaseFunction

      @SPI({USE,IMPLEMENT}) public String getLowercaseFunction()

      The unquoted SQL function name which transforms a string to lowercase.

      Return only the stable function name, without parentheses or arguments; Hibernate composes the invocation. The standard name is lower.

      Returns:
      the non-null lowercase function name
    • getPredicateSupport

      @SPI({IMPLEMENT,SUPPLY}) public PredicateSupport getPredicateSupport()

      The database's native predicate syntax and predicate-placement profile.

      Override this method to supply independent support for a native case-insensitive-like operator, scalar distinct from, truthness predicates, and predicates used as value expressions. An absent case-insensitive-like operator selects Hibernate's lowercase-expression emulation. Return one immutable, non-null profile whose values remain stable for the lifetime of this Dialect; do not override individual consumers to reproduce these decisions.

      Returns:
      this Dialect's stable predicate-support profile
      Since:
      8.0
    • getRowValueSupport

      @SPI({IMPLEMENT,SUPPLY}) public RowValueSupport getRowValueSupport()

      The native row-value syntax of this Dialect.

      Override this method to supply explicit row(a, b) construction, row equality, ordering, and distinctness comparisons, row-valued IN lists, row-valued IN subqueries, and quantified row comparisons. Treat each feature as an exact native-syntax declaration: do not infer IN-subquery support from IN-list support or explicit row construction from comparison support. Copy the superclass profile when refining an inherited Dialect family. Return one immutable, non-null profile whose values remain stable for the lifetime of this Dialect.

      Returns:
      this Dialect's stable row-value-support profile
      Since:
      8.0
    • getSetOperationSupport

      @SPI({IMPLEMENT,SUPPLY}) public SetOperationSupport getSetOperationSupport()

      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 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.

      Returns:
      this Dialect's stable set-operation profile
      Since:
      8.0
    • getSubquerySupport

      @SPI({IMPLEMENT,SUPPLY}) public SubquerySupport getSubquerySupport()

      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.

      Returns:
      this Dialect's stable subquery-support profile
      Since:
      8.0
    • getExpressionCoercionSupport

      @SPI({IMPLEMENT,SUPPLY}) public ExpressionCoercionSupport getExpressionCoercionSupport()

      Supplies the expression-coercion adaptations required by this database.

      Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Each requirement directs a focused rendering adaptation; it does not report general database cast support. When refining a family Dialect, start from ExpressionCoercionSupport.builder(super.getExpressionCoercionSupport()) and change only the differing requirement.

      Returns:
      this Dialect's stable expression-coercion requirement profile
      Since:
      8.0
    • getWindowFunctionSupport

      @SPI({IMPLEMENT,SUPPLY}) public WindowFunctionSupport getWindowFunctionSupport()

      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.

      Returns:
      this Dialect's stable window-function-support profile
      Since:
      8.0
    • getIdentifierSupport

      @SPI({IMPLEMENT,SUPPLY}) public IdentifierSupport getIdentifierSupport()

      Supply identifier quoting, limits, and helper construction.

      Return one stable, non-null strategy for this Dialect's lifetime.

      Since:
      8.0
      See Also:
    • getKeywordSupport

      @SPI({IMPLEMENT,SUPPLY}) public KeywordSupport getKeywordSupport()

      Supply the stable Dialect keyword profile and JDBC-keyword filter.

      Return one stable, non-null strategy for this Dialect's lifetime.

      Since:
      8.0
      See Also:
    • getKeywords

      @SPI(USE) public final Set<String> getKeywords()
      Return the immutable ANSI and Dialect-defined keyword profile.
      Specified by:
      getKeywords in interface KeywordSupport
    • getLiteralSupport

      @SPI({IMPLEMENT,SUPPLY}) public LiteralSupport getLiteralSupport()

      Supply SQL literal rendering.

      Return one stable, non-null strategy for this Dialect's lifetime.

      Since:
      8.0
      See Also:
    • getIfExistsSupport

      @SPI({IMPLEMENT,SUPPLY}) public IfExistsSupport getIfExistsSupport()

      Supply existence-check placement for schema DDL targets.

      Return one immutable profile for this Dialect's lifetime.

      Since:
      8.0
      See Also:
    • getAlterTableSupport

      @SPI({IMPLEMENT,SUPPLY}) public AlterTableSupport getAlterTableSupport()

      Supply alter-table and add-column grammar.

      Return a stable strategy and do not retain AlterColumnTypeRequest instances. A Dialect may implement AlterTableSupport directly and return itself so subclass overrides retain ordinary Java dispatch.

      Since:
      8.0
      See Also:
    • getTableCreationSupport

      @SPI({IMPLEMENT,SUPPLY}) public TableCreationSupport getTableCreationSupport()

      Supply table and view creation grammar.

      Return a stable strategy after configured storage-engine and version choices are resolved.

      Since:
      8.0
      See Also:
    • getColumnDefinitionSupport

      @SPI({IMPLEMENT,SUPPLY}) public ColumnDefinitionSupport getColumnDefinitionSupport()

      Supply non-identity column-definition composition.

      Consume rendered request values without retaining mapping or call-scoped state.

      Since:
      8.0
      See Also:
    • getIndexDdlSupport

      @SPI({IMPLEMENT,SUPPLY}) public IndexDdlSupport getIndexDdlSupport()

      Supply index creation grammar and name qualification policy.

      Consume supported immutable column views without depending on mutable mapping-model internals.

      Since:
      8.0
      See Also:
    • getConstraintControlSupport

      @SPI({IMPLEMENT,SUPPLY}) public ConstraintControlSupport getConstraintControlSupport()

      Supply the strategy for controlling constraints during table cleaning.

      Implement only the command family selected by ConstraintControlSupport.constraintControlMode().

      Since:
      8.0
      See Also:
    • constraintControlMode

      public ConstraintControlMode constraintControlMode()
      Specified by:
      constraintControlMode in interface ConstraintControlSupport
    • getTruncateSupport

      @SPI({IMPLEMENT,SUPPLY}) public TruncateSupport getTruncateSupport()

      Supply ordered table-truncation commands.

      Return an empty command list for an empty request and preserve table order.

      Since:
      8.0
      See Also:
    • truncateMode

      public TruncateMode truncateMode()
      Specified by:
      truncateMode in interface TruncateSupport
    • getSchemaDropSupport

      @SPI({IMPLEMENT,SUPPLY}) public SchemaDropSupport getSchemaDropSupport()

      Supply schema-drop composition and ordered pre-drop commands.

      Return one immutable profile for this Dialect's lifetime.

      Since:
      8.0
      See Also:
    • getTableExporter

      @SPI({USE,IMPLEMENT,SUPPLY}) public Exporter<Table> getTableExporter()

      Supply the exporter used to create and drop relational tables.

      Return one stable exporter owned by this Dialect. Prefer StandardTableExporter when only its focused table-DDL template hooks are needed.

    • getTableMigrator

      @SPI({IMPLEMENT,SUPPLY}) public TableMigrator getTableMigrator()

      Supply the strategy which migrates relational table definitions.

      Return one stable migrator for this Dialect's lifetime.

      Since:
      8.0
      See Also:
    • getTableCleaner

      @SPI({IMPLEMENT,SUPPLY}) public TableCleaner getTableCleaner()

      Supply the strategy which produces complete table-cleaning commands.

      Return one stable cleaner whose reported modes agree with its command families.

      Since:
      8.0
      See Also:
    • getUserDefinedTypeExporter

      @SPI({USE,IMPLEMENT,SUPPLY}) public Exporter<UserDefinedType> getUserDefinedTypeExporter()

      Supply the exporter used to create and drop user-defined types.

      Return one stable exporter owned by this Dialect. Use StandardUserDefinedTypeExporter when standard object-type DDL is sufficient.

    • getSequenceExporter

      @SPI({USE,IMPLEMENT,SUPPLY}) public Exporter<Sequence> getSequenceExporter()

      Supply the exporter used to create and drop relational sequences.

      Return one stable exporter owned by this Dialect. Prefer StandardSequenceExporter when only sequence-name qualification differs.

    • getIndexExporter

      @SPI({IMPLEMENT,SUPPLY}) public Exporter<Index> getIndexExporter()

      Supply the exporter used to create and drop relational indexes.

      Return one stable exporter owned by this Dialect. Use StandardIndexExporter when standard index DDL is sufficient.

    • getForeignKeyExporter

      @SPI({USE,IMPLEMENT,SUPPLY}) public Exporter<ForeignKey> getForeignKeyExporter()

      Supply the exporter used to create and drop foreign-key constraints.

      Return one stable exporter owned by this Dialect. Compose StandardForeignKeyExporter when the database decorates otherwise standard foreign-key DDL.

    • getTemporaryTableExporter

      @SPI({IMPLEMENT,SUPPLY}) public TemporaryTableExporter getTemporaryTableExporter()

      Supplies the runtime DDL exporter for temporary-table descriptors.

      The exporter must agree with the TemporaryTableStrategy instances supplied by this Dialect. Prefer StandardTemporaryTableExporter unless the database requires a different assembly of table or column fragments. The returned exporter must be non-null and safe for reuse.

    • getPersistentTemporaryTableStrategy

      @SPI({IMPLEMENT,SUPPLY}) public TemporaryTableStrategy getPersistentTemporaryTableStrategy()

      Supplies the fallback persistent-table strategy used when no native local or global temporary-table strategy is selected.

      The returned strategy must be non-null and must describe behavior consistent with getTemporaryTableExporter().

      Since:
      7.1
    • getLocalTemporaryTableStrategy

      @SPI({IMPLEMENT,SUPPLY}) @Nullable public TemporaryTableStrategy getLocalTemporaryTableStrategy()

      Supplies this Dialect's local temporary-table strategy.

      Return null when the database has no supported local temporary-table form. A non-null strategy must be stable for the Dialect lifetime and consistent with getTemporaryTableExporter().

      Since:
      7.1
    • getGlobalTemporaryTableStrategy

      @SPI({IMPLEMENT,SUPPLY}) @Nullable public TemporaryTableStrategy getGlobalTemporaryTableStrategy()

      Supplies this Dialect's global temporary-table strategy.

      Return null when the database has no supported global temporary-table form. A non-null strategy must be stable for the Dialect lifetime and consistent with getTemporaryTableExporter().

      Since:
      7.1
    • getNamespaceSupport

      @SPI({IMPLEMENT,SUPPLY}) public NamespaceSupport getNamespaceSupport()

      Supply catalog and schema lifecycle behavior to schema tooling.

      Return one stable, non-null strategy. Prefer a complete immutable profile from NamespaceSupports, and implement NamespaceSupport directly only for custom or multi-command namespace SQL.

      Since:
      8.0
      See Also:
    • getSchemaNameResolver

      @SPI({IMPLEMENT,SUPPLY}) public SchemaNameResolver getSchemaNameResolver()

      Supply the strategy which resolves the current schema for a JDBC connection.

      Return a stable, non-null resolver. Use the default resolver unless the driver cannot implement Connection.getSchema() correctly.

      See Also:
    • getForeignKeySupport

      @SPI({IMPLEMENT,SUPPLY}) public ForeignKeySupport getForeignKeySupport()

      Supply this Dialect's foreign-key DDL and delete-semantics strategy.

      The default strategy is this Dialect. Return one stable, non-null strategy when the database requires composition instead of direct overrides.

      Since:
      8.0
      See Also:
    • getCheckConstraintSupport

      @SPI({IMPLEMENT,SUPPLY}) public CheckConstraintSupport getCheckConstraintSupport()

      Supply this Dialect's check-constraint placement and rendering strategy.

      The default strategy is this Dialect. A strategy supporting named column checks must also support anonymous column checks.

      Since:
      8.0
      See Also:
    • getSchemaCommentSupport

      @SPI({IMPLEMENT,SUPPLY}) public SchemaCommentSupport getSchemaCommentSupport()

      Supply schema-export support for comments attached to database objects.

      This strategy does not control query comments, hints, SQL AST decoration, or statement inspection. Return one stable, non-null strategy.

      Since:
      8.0
      See Also:
    • getColumnAliasExtractor

      @SPI({USE,IMPLEMENT,SUPPLY}) public ColumnAliasExtractor getColumnAliasExtractor()

      Supplies the strategy used to extract projected column aliases from JDBC result-set metadata during native-query auto-discovery.

      Return ColumnAliasExtractor.COLUMN_LABEL_EXTRACTOR unless the JDBC driver requires extraction through ResultSetMetaData.getColumnName(int). The returned strategy must be stable and thread-safe.

      Returns:
      the non-null alias extractor
      Since:
      8.0
      See Also:
    • getLobSupport

      @SPI({IMPLEMENT,SUPPLY}) public LobSupport getLobSupport()
      Supply the database and driver policy for LOB creation, binding, materialization, type classification, mutation ordering, and VALUE LOB DDL. Return one stable, thread-safe strategy for this Dialect.
      Returns:
      the non-null LOB support strategy
      Since:
      8.0
      See Also:
    • supportsOrdinalSelectItemReference

      @SPI({IMPLEMENT,SUPPLY}) public boolean supportsOrdinalSelectItemReference()

      Determine whether query clauses may refer to select items by their one-based ordinal position.

      Override this method when the database does not accept ordinal select-item references. SQL AST translators use the result to choose between rendering the ordinal and rendering the underlying expression.

      Returns:
      true when ordinal select-item references are supported
      Since:
      8.0
    • getNullOrderingSupport

      @SPI({IMPLEMENT,SUPPLY}) public NullOrderingSupport getNullOrderingSupport()

      Supply the database's default null ordering and explicit null-precedence syntax capabilities.

      Override this method with a stable, non-null profile when the database's default null placement differs from NullOrderingSupport.STANDARD, or when it cannot render nulls first and nulls last natively. Dialect subclasses refining a family profile should copy getNullOrderingSupport() from the superclass and change only the values which differ.

      Returns:
      the stable, non-null null-ordering-support profile
      Since:
      8.0
    • getTupleCountSupport

      @SPI({IMPLEMENT,SUPPLY}) public TupleCountSupport getTupleCountSupport()

      Supplies the database syntax for ordinary and distinct tuple counts.

      Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Select TupleCountSupport.Syntax.UNSUPPORTED to use Hibernate's existing emulation, TupleCountSupport.Syntax.ARGUMENT_LIST for syntax such as count(a, b), or TupleCountSupport.Syntax.PARENTHESIZED_TUPLE for syntax such as count((a, b)). Configure the ordinary and distinct forms independently; a database may require different forms for them. When refining a family Dialect, copy getTupleCountSupport() from the superclass and replace only the differing syntax choice.

      Returns:
      the non-null tuple-count-syntax profile
      Since:
      8.0
    • getParameterLimits

      @SPI({IMPLEMENT,SUPPLY}) public ParameterLimits getParameterLimits()

      Supplies the database limits for IN-expression elements and total JDBC statement parameters.

      Return a non-null, immutable profile whose values remain stable for this Dialect's lifetime. Use ParameterLimits.UNLIMITED when neither limit applies and ParameterLimits.of(int) when both limits are identical. Keep the dimensions independent when the database imposes different expression and statement limits; Hibernate uses them for different planning decisions.

      Returns:
      the non-null parameter-limit profile
      Since:
      8.0
    • getStringValueSemantics

      @SPI({IMPLEMENT,SUPPLY}) public StringValueSemantics getStringValueSemantics()
      Supply the database's stable string-value semantics.
      Returns:
      the non-null string-value profile
      Since:
      8.0
      See Also:
    • getUniqueDelegate

      @SPI({IMPLEMENT,SUPPLY}) public UniqueDelegate getUniqueDelegate()

      Supply the stable strategy used for unique-key representation and DDL.

      Return a stock profile from UniqueDelegates, or a stable provider-owned implementation or decorator. Do not import a Hibernate .internal leaf.

      Since:
      8.0
      See Also:
    • getQueryHintString

      @SPI({USE,IMPLEMENT}) public String getQueryHintString(String query, List<String> hintList)
      Apply a hint to the given SQL query.

      The entire query is provided, allowing full control over the placement and syntax of the hint.

      By default, ignore the hint and simply return the query.

      Parameters:
      query - The query to which to apply the hint.
      hintList - The hints to apply
      Returns:
      The modified SQL
    • getQueryHintString

      @SPI({USE,IMPLEMENT}) public String getQueryHintString(String query, String hints)
      Apply a hint to the given SQL query.

      The entire query is provided, allowing full control over the placement and syntax of the hint.

      By default, ignore the hint and simply return the query.

      Parameters:
      query - The query to which to apply the hint.
      hints - The hints to apply
      Returns:
      The modified SQL
    • getQueryHintPlacement

      @SPI({IMPLEMENT,SUPPLY}) public QueryHintPlacement getQueryHintPlacement()

      Supply the final placement of a leading database hint relative to a user SQL comment.

      Return one stable value. Select BEFORE_COMMENT only when the database requires its hint to be the first leading SQL comment.

      Since:
      8.0
      See Also:
    • defaultScrollMode

      @SPI({USE,IMPLEMENT,SUPPLY}) public ScrollMode defaultScrollMode()
      A default ScrollMode to be used by Query.scroll().
      Returns:
      the default ScrollMode to use.
      API Note:
      Certain dialects support a subset of ScrollModes.
    • getGeneratedValuesSupport

      @SPI({IMPLEMENT,SUPPLY}) public GeneratedValuesSupport getGeneratedValuesSupport()

      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 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.

      Since:
      8.0
    • getJdbcMetadataOverrides

      @SPI({IMPLEMENT,SUPPLY}) public JdbcMetadataOverrides getJdbcMetadataOverrides()

      Supply the stable overrides applied to raw JDBC metadata reports.

      Return one non-null immutable profile whose identity and answers remain stable for this Dialect's lifetime. Use REPORTED to retain Hibernate's interpreted driver answer, and force SUPPORTED or UNSUPPORTED only when the selected driver report is known to be inaccurate. This profile controls effective JDBC behavior, not callable SQL syntax.

      Returns:
      the effective JDBC metadata overrides
      Since:
      8.0
      See Also:
    • getFetchClauseSupport

      @SPI({USE,IMPLEMENT,SUPPLY}) public FetchClauseSupport getFetchClauseSupport()

      Supply the fetch clause forms accepted by this database.

      Return one non-null immutable profile whose identity and answers remain stable for this Dialect's lifetime. The four forms are independent; do not infer percent or ties support from ordinary row-count support.

      Returns:
      the stable fetch clause capability profile
      Since:
      8.0
      See Also:
    • getSyntheticTableGroupSupport

      @SPI({IMPLEMENT,SUPPLY}) public SyntheticTableGroupSupport getSyntheticTableGroupSupport()

      Supply the strategy for synthetic table roots required while converting grouping and ordering expressions to SQL AST.

      Return one non-null immutable or thread-safe strategy whose answers remain stable for this Dialect's lifetime. This strategy controls query structure; it does not apply to DDL, temporary tables, or no-column inserts.

      Returns:
      the synthetic-table strategy
      Since:
      8.0
      See Also:
    • getCallableStatementSupport

      @SPI({IMPLEMENT,SUPPLY}) public CallableStatementSupport getCallableStatementSupport()

      Supply the callable-statement protocol for this database and JDBC driver.

      Return one non-null strategy whose behavior remains stable for this Dialect's lifetime. Use CallableStatementSupports for the standard and stock database protocols.

      Returns:
      the callable-statement strategy
      Since:
      8.0
      See Also:
    • getRefCursorSupportFactory

      @SPI({IMPLEMENT,SUPPLY}) public RefCursorSupportFactory getRefCursorSupportFactory()

      Supply the stable factory which creates this Dialect's JDBC REF_CURSOR registration and extraction service.

      Return one non-null factory whose identity and selection behavior remain stable for this Dialect's lifetime. This factory controls JDBC cursor access; getCallableStatementSupport() independently controls whether and how the callable SQL protocol admits a REF_CURSOR parameter.

      Returns:
      the REF_CURSOR JDBC access factory
      Since:
      8.0
      See Also:
    • getNameQualifierSupport

      @SPI({USE,IMPLEMENT,SUPPLY}) @Nullable public NameQualifierSupport getNameQualifierSupport()

      Supply catalog and schema qualification support, or return null to use DatabaseMetaData.

      This value does not define the catalog separator; override getCatalogSeparator() independently when the metadata-free fallback is not ..

      See Also:
    • getMultiKeyLoadSizingStrategy

      @SPI({IMPLEMENT,SUPPLY}) public MultiKeyLoadSizingStrategy getMultiKeyLoadSizingStrategy()
      The strategy used to determine the appropriate number of keys to load in a single SQL query with multi-key loading.
      See Also:
    • getBatchLoadSizingStrategy

      @SPI({IMPLEMENT,SUPPLY}) public MultiKeyLoadSizingStrategy getBatchLoadSizingStrategy()
      The strategy used to determine the appropriate number of keys to load in a single SQL query with batch-fetch loading.
      See Also:
      Implementation Note:
      By default, the same as getMultiKeyLoadSizingStrategy()
    • isJdbcLogWarningsEnabledByDefault

      @SPI({IMPLEMENT,SUPPLY}) public boolean isJdbcLogWarningsEnabledByDefault()
      Is JDBC statement warning logging enabled by default?
      Since:
      5.1
    • augmentPhysicalTableTypes

      @SPI({USE,IMPLEMENT}) public void augmentPhysicalTableTypes(List<String> tableTypesList)

      Append database-specific physical table types to tableTypesList.

      The initial list contains configured extra physical types in configuration order. Preserve existing elements, case, order, and duplicates, and do not retain the mutable list.

    • augmentRecognizedTableTypes

      @SPI({USE,IMPLEMENT}) public void augmentRecognizedTableTypes(List<String> tableTypesList)

      Append database-specific recognized table types to tableTypesList.

      The initial list starts with TABLE, VIEW, enabled synonym types, and every physical type. Preserve existing elements, case, order, and duplicates, and do not retain the mutable list.

    • addPartitionKeyToPrimaryKey

      @Incubating(since="7.1") @SPI({USE,IMPLEMENT}) public boolean addPartitionKeyToPrimaryKey()

      Whether every table partition key must also occur in its primary key.

      Return true only when the database requires the rule for both ordinary and temporal-history tables. This has nothing to do with window-function partitioning.

      Since:
      7.1
    • getNationalizationSupport

      @SPI({USE,IMPLEMENT,SUPPLY}) public NationalizationSupport getNationalizationSupport()

      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 supportsNationalizedMethods() separately when the driver cannot use those methods.

      Returns:
      the database nationalization profile
      Since:
      8.0
      See Also:
    • supportsNationalizedMethods

      @SPI({USE,IMPLEMENT,SUPPLY}) public boolean supportsNationalizedMethods()

      Determine whether the JDBC driver correctly implements the nationalized ResultSet, PreparedStatement, and CallableStatement methods.

      This driver capability is independent of the database SQL-type semantics described by getNationalizationSupport(). A provider should return false when the driver requires the ordinary character methods even if the database supports explicit nationalized types.

      Returns:
      true when nationalized JDBC access methods may be used
      Since:
      8.0
      See Also:
    • getAggregateSupport

      @SPI({IMPLEMENT,SUPPLY}) public AggregateSupport getAggregateSupport()
      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.
      Returns:
      this dialect's aggregate support
      Since:
      8.0
      See Also:
    • supportsUserDefinedTypes

      @SPI({IMPLEMENT,SUPPLY}) public boolean supportsUserDefinedTypes()

      Whether mapped aggregate structures may be represented as database user-defined types.

      This capability is independent of getUserDefinedTypeExporter(), which supplies schema commands for any UDT definitions that are present.

      Since:
      7.1
      See Also:
    • getArraySupport

      @SPI({IMPLEMENT,SUPPLY}) public ArraySupport getArraySupport()

      The independent array syntax and multi-valued parameter-binding behavior of this Dialect.

      Override this method to supply standard element-type array support, SQL array-constructor support, and the multi-valued parameter-binding strategy. Treat these as independent dimensions: do not infer syntax support from array binding, and do not infer array binding from either syntax capability. Return one immutable, non-null profile whose values remain stable for the lifetime of this Dialect.

      Returns:
      this Dialect's stable array-support profile
      Since:
      8.0
    • getArrayTypeName

      @SPI({USE,IMPLEMENT}) @Nullable public String getArrayTypeName(String javaElementTypeName, String elementTypeName, @Nullable Integer maxLength)

      Render an array type name from the independent Java element name, rendered SQL element name, and optional maximum length.

      Return null when array types are unsupported. The standard forms are element array and element array[length].

      Since:
      6.1
    • appendArrayLiteral

      @SPI({USE,IMPLEMENT}) public void appendArrayLiteral(SqlAppender appender, Object[] literal, JdbcLiteralFormatter<Object> elementFormatter, WrapperOptions wrapperOptions)

      Append an array literal using this Dialect's standard array support.

      Append immediately and do not retain the appender, values, formatter, or wrapper options.

      Specified by:
      appendArrayLiteral in interface LiteralSupport
    • getPreferredSqlTypeCodeForArray

      @SPI({USE,IMPLEMENT,SUPPLY}) public int getPreferredSqlTypeCodeForArray()

      Select the default SqlTypes code for a basic Java array or collection.

      Return the container type Hibernate should request when no local mapping selects one. Typical choices are SqlTypes.ARRAY, SqlTypes.TABLE, SqlTypes.JSON_ARRAY, SqlTypes.XML_ARRAY, and SqlTypes.VARBINARY. The hibernate.type.preferred_array_jdbc_type setting takes precedence over this Dialect default. This method selects a type code; contribute a JDBC descriptor or customize DDL rendering through their dedicated contracts.

      Returns:
      a container type code defined by SqlTypes
      Since:
      8.0
      See Also:
    • getPreferredSqlTypeCodeForBoolean

      @SPI({USE,IMPLEMENT,SUPPLY}) public int getPreferredSqlTypeCodeForBoolean()

      Select the default SqlTypes code for Java boolean mappings.

      Return a Boolean-compatible code such as SqlTypes.BOOLEAN, SqlTypes.BIT, SqlTypes.SMALLINT, SqlTypes.TINYINT, or SqlTypes.INTEGER. The hibernate.type.preferred_boolean_jdbc_type setting takes precedence over this Dialect default. This method selects a type code; contribute a JDBC descriptor or customize DDL rendering through their dedicated contracts.

      Returns:
      a Boolean-compatible type code defined by SqlTypes
      Since:
      8.0
      See Also:
    • getCteSupport

      @SPI({IMPLEMENT,SUPPLY}) public CteSupport getCteSupport()

      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.

    • getMutationSyntaxSupport

      @SPI({IMPLEMENT,SUPPLY}) public MutationSyntaxSupport getMutationSyntaxSupport()

      The native SQL mutation-syntax capabilities of this Dialect.

      The returned immutable profile must be non-null and stable for the lifetime of this Dialect. Report syntax which the translator may use directly; do not report a capability merely because it can be emulated. QueryMutationRenderingSupport consumes this profile when selecting a native or emulated plan.

    • getValuesListSupport

      @SPI({IMPLEMENT,SUPPLY}) public ValuesListSupport getValuesListSupport()

      The contexts in which this Dialect supports native multi-row values syntax.

      The returned immutable profile must be non-null and stable for the lifetime of this Dialect. Report only native syntax support; translator emulation is selected separately.

    • getSqlAstTranslatorFactory

      @SPI({IMPLEMENT,SUPPLY}) public SqlAstTranslatorFactory getSqlAstTranslatorFactory()

      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.

      See Also:
    • getSizeStrategy

      @SPI({IMPLEMENT,SUPPLY}) public SizeStrategy getSizeStrategy()

      Supply the strategy which resolves column sizes for mapped Java and JDBC types.

      Return the standard strategy unless this database changes column-size resolution. For focused deviations, construct a stable StandardSizeStrategy with this Dialect, override the affected cases, and delegate all other cases to the standard implementation. The result must be non-null and stable for the lifetime of this Dialect.

      Since:
      8.0
    • getTypeSizingProfile

      @SPI({IMPLEMENT,SUPPLY}) public TypeSizingProfile getTypeSizingProfile()

      Supplies this Dialect's resolved type-sizing limits and defaults.

      Return TypeSizingProfile.STANDARD when no dimension differs. Construct one stable immutable profile after version and server configuration are known. A family Dialect may copy its superclass profile, but must set every effective dimension which formerly changed through scalar-method delegation because profile builder setters do not cascade.

      Since:
      8.0
    • createOptionalTableUpdateOperation

      @SPI({USE,IMPLEMENT,SUPPLY}) public MutationOperation createOptionalTableUpdateOperation(OptionalTableUpdateOperationRequest request)

      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.

      Returns:
      a non-null operation for the supplied optional-table update
      See Also:
    • getNativeParameterMarkerStrategy

      @SPI({USE,IMPLEMENT,SUPPLY}) public ParameterMarkerStrategy getNativeParameterMarkerStrategy()

      Supply the native parameter-marker strategy selected for this database and JDBC driver.

      Return null to use JDBC-standard ? markers. A non-null result must remain stable after bootstrap and must not retain JDBC types passed to it.

      Returns:
      the native strategy, or null for JDBC-standard markers
      See Also:
    • getDefaultOrdinalityColumnName

      @SPI({IMPLEMENT,SUPPLY}) @Nullable public String getDefaultOrdinalityColumnName()

      Supplies the preferred default ordinality-column name for a set-returning function.

      Return a stable, unqualified SQL column name, or null when the database does not define a preferred name. Hibernate uses i as the fallback and applies collision suffixing where necessary. A null result does not mean that set-returning functions are unsupported.

      Returns:
      the preferred unqualified name, or null to use Hibernate's fallback
      Since:
      8.0
    • causesRollback

      @SPI({IMPLEMENT,SUPPLY}) public boolean causesRollback(SQLException sqlException)

      Determine whether this database marks the current transaction for rollback after the given statement failure.

      Inspect the original database exception when the policy depends on its error code, SQL state, or subtype. This decision is independent of how Hibernate converts the exception. This determines both JDBC rollback state and whether a pessimistic lock failure becomes a JPA PessimisticLockException or LockTimeoutException.

      Parameters:
      sqlException - the original database exception
      Returns:
      true when the failed statement invalidates the transaction
      Since:
      8.0
    • getTemporalTableSupport

      @Incubating(since="7.4") @SPI({IMPLEMENT,SUPPLY}) public TemporalTableSupport getTemporalTableSupport()

      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.

      Returns:
      the non-null temporal-table support strategy
      Since:
      8.0
      See Also:
    • appendDateTimeLiteral

      @SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone)

      Append a datetime literal for a java.time value.

      Preserve the value's offset only when the Dialect's temporal-value semantics permit it. Append immediately and retain no invocation state.

      Specified by:
      appendDateTimeLiteral in interface LiteralSupport
    • appendDateTimeLiteral

      @SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone)

      Append a datetime literal for a legacy Date value.

      Apply the supplied JDBC time zone where required, append immediately, and retain no invocation state.

      Specified by:
      appendDateTimeLiteral in interface LiteralSupport
    • appendDateTimeLiteral

      @SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone)

      Append a datetime literal for a Calendar value.

      Preserve Calendar-specific time-zone and millisecond semantics, append immediately, and retain no invocation state.

      Specified by:
      appendDateTimeLiteral in interface LiteralSupport
    • getTimeZoneSupport

      @SPI({IMPLEMENT,SUPPLY}) public TimeZoneSupport getTimeZoneSupport()

      Select the database's support profile for SQL with time zone types.

      Override this method to report whether the database preserves the original zone, normalizes values to UTC, or has no native support. This value participates in mapping and JDBC type selection; it does not control temporal-literal syntax.

      Returns:
      the database time-zone type support profile
      Since:
      8.0
      See Also:
    • getRowIdSupport

      @SPI({IMPLEMENT,SUPPLY}) public RowIdSupport getRowIdSupport()
      Supply the database's row-locator expression, JDBC type, and optional physical-column declaration policy.
      Returns:
      the stable non-null row-id strategy
      Since:
      8.0
      See Also:
    • getDmlTargetColumnQualifierSupport

      @SPI({USE,IMPLEMENT,SUPPLY}) public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport()

      The qualifier form accepted for target-column references in update and delete statements.

      Translators use this value when rendering assignments and predicates. A custom Dialect should return the least permissive form required by the database, not a form used only by an emulation.

      Returns:
      the non-null target-column qualifier support
      See Also:
    • getFunctionalDependencyAnalysisSupport

      @SPI({IMPLEMENT,SUPPLY}) public FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport()

      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.

      Returns:
      a non-null immutable capability profile
      Since:
      8.0
      See Also:
    • getObjectNullBindingStrategy

      @SPI({IMPLEMENT,SUPPLY}) public ObjectNullBindingStrategy getObjectNullBindingStrategy()
      Supply the JDBC strategy for binding an untyped Java null.
      Returns:
      the non-null binding strategy
      Since:
      8.0
      See Also:
    • throttleDdl

      @Incubating(since="7.4") @Deprecated(forRemoval=true) public boolean throttleDdl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This temporary schema-management workaround will be removed once affected databases no longer require it.
      Whether schema-management DDL commands require a short delay before execution to accommodate database-side propagation.
    • supportsFilterClause

      @SPI({IMPLEMENT,SUPPLY}) public boolean supportsFilterClause()

      Whether this database supports native aggregate filter (where ...) syntax.

      Return a stable answer for this Dialect's lifetime. A false result directs aggregate rendering to use the existing case-expression emulation; it does not mean that filtered aggregates are unsupported.

      Since:
      8.0
    • supportsCrossJoin

      @SPI({IMPLEMENT,SUPPLY}) public boolean supportsCrossJoin()

      Whether this database supports ANSI cross join syntax.

      Return a stable answer for this Dialect's lifetime. A false result directs SQL AST rendering to use its unqualified join with a true predicate and is independent of the database's getSingleRowTableSupport() profile.

      Since:
      8.0