Class H2Dialect

java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.dialect.H2Dialect
All Implemented Interfaces:
CheckConstraintSupport, ForeignKeySupport, IdentifierSupport, KeywordSupport, LiteralSupport, AlterTableSupport, ColumnDefinitionSupport, ConstraintControlSupport, IndexDdlSupport, TableCreationSupport, TruncateSupport, CurrentTemporalSupport, TemporalFormatSupport, TemporalOperationSupport, ConversionContext

A SQL dialect for H2.

Please refer to the H2 documentation.

  • Constructor Details

  • Method Details

    • getTemporalOperationSupport

      @SPI({IMPLEMENT,SUPPLY}) public TemporalOperationSupport getTemporalOperationSupport()
      Description copied from class: Dialect
      Supply extraction and timestamp-arithmetic syntax. Return one stable, non-null, thread-safe implementation. Providers may implement TemporalOperationSupport directly and return this.
      Overrides:
      getTemporalOperationSupport in class Dialect
      See Also:
    • getTemporalFormatSupport

      @SPI({IMPLEMENT,SUPPLY}) public TemporalFormatSupport getTemporalFormatSupport()
      Description copied from class: Dialect
      Supply datetime-format translation. Return one stable, non-null, thread-safe implementation.
      Overrides:
      getTemporalFormatSupport in class Dialect
      See Also:
    • getCurrentTemporalSupport

      @SPI({IMPLEMENT,SUPPLY}) public CurrentTemporalSupport getCurrentTemporalSupport()
      Description copied from class: Dialect
      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.
      Overrides:
      getCurrentTemporalSupport in class Dialect
      See Also:
    • getTypeSizingProfile

      public TypeSizingProfile getTypeSizingProfile()
      Description copied from class: Dialect

      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.

      Overrides:
      getTypeSizingProfile in class Dialect
    • determineDatabaseVersion

      @SPI({USE,IMPLEMENT}) public DatabaseVersion determineDatabaseVersion(DialectResolutionInfo info)
      Description copied from class: Dialect
      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.

      Overrides:
      determineDatabaseVersion in class Dialect
      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.
    • 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 Dialect
    • contributeDefaultProperties

      @SPI({IMPLEMENT,SUPPLY}) protected void contributeDefaultProperties(Properties properties)
      Description copied from class: Dialect

      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 Dialect.getDefaultProperties() from a Dialect constructor.

      Overrides:
      contributeDefaultProperties in class Dialect
      Parameters:
      properties - the isolated contribution target
    • getArraySupport

      public ArraySupport getArraySupport()
      Description copied from class: Dialect

      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.

      Overrides:
      getArraySupport in class Dialect
      Returns:
      this Dialect's stable array-support profile
    • columnType

      @SPI({USE,IMPLEMENT}) protected String columnType(int sqlTypeCode)
      Description copied from class: Dialect

      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.

      Overrides:
      columnType in class Dialect
    • castType

      @SPI({USE,IMPLEMENT}) 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 Dialect
    • narrowCastType

      @SPI({USE,IMPLEMENT}) protected String narrowCastType(int sqlTypeCode)
      Description copied from class: Dialect

      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 Dialect.columnType(int).

      Overrides:
      narrowCastType in class Dialect
    • 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 Dialect
      Parameters:
      typeContributions - the Hibernate-supplied contribution target
      serviceRegistry - the Hibernate-supplied bootstrap services
      See Also:
    • 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 Dialect
      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.

    • 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 Dialect
      Returns:
      this dialect's aggregate support
      See Also:
    • hasOddDstBehavior

      public boolean hasOddDstBehavior()
    • 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 Dialect
      Parameters:
      functionContributions - the Hibernate-supplied function contribution target
      See Also:
    • getMaximumArraySize

      protected int getMaximumArraySize()
      H2 requires a very special emulation, because unnest is pretty much useless, due to issue 1815. This emulation uses array_get, array_length and system_range functions to roughly achieve the same, but requires that system_range is fed with a "maximum array size".
    • getMaximumSeriesSize

      protected int getMaximumSeriesSize()
      Since H2 doesn't support ordinality for the system_range function or lateral, it's impossible to use system_range for non-constant cases. Luckily, correlation can be emulated, but requires that there is an upper bound on the amount of elements that the series can return.
    • getDefaultOrdinalityColumnName

      @Nullable public String getDefaultOrdinalityColumnName()
      Description copied from class: Dialect

      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.

      Overrides:
      getDefaultOrdinalityColumnName in class Dialect
      Returns:
      the preferred unqualified name, or null to use Hibernate's fallback
    • augmentPhysicalTableTypes

      @SPI(IMPLEMENT) public void augmentPhysicalTableTypes(List<String> tableTypesList)
      Description copied from class: Dialect

      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.

      Overrides:
      augmentPhysicalTableTypes in class Dialect
    • resolveSqlTypeCode

      @SPI({USE,IMPLEMENT}) protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration)
      Description copied from class: Dialect

      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.

      Overrides:
      resolveSqlTypeCode in class Dialect
    • 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 Dialect
    • resolveSqlTypeCode

      @SPI({USE,IMPLEMENT}) protected Integer resolveSqlTypeCode(String typeName, String baseTypeName, TypeConfiguration typeConfiguration)
      Description copied from class: Dialect
      Resolve a database-reported type using both its complete and normalized base names. Return null when neither identifies a registered type.
      Overrides:
      resolveSqlTypeCode in class Dialect
    • currentTime

      @SPI({USE,IMPLEMENT}) public String currentTime()
      Description copied from interface: CurrentTemporalSupport
      Render the current SQL time expression used for java.sql.Time.
      Specified by:
      currentTime in interface CurrentTemporalSupport
    • currentTimestamp

      @SPI({USE,IMPLEMENT}) public String currentTimestamp()
      Description copied from interface: CurrentTemporalSupport
      Render the current SQL timestamp expression used for java.sql.Timestamp.
      Specified by:
      currentTimestamp in interface CurrentTemporalSupport
    • currentTimestampWithTimeZone

      @SPI({USE,IMPLEMENT}) public String currentTimestampWithTimeZone()
      Description copied from interface: CurrentTemporalSupport
      Render the current timestamp-with-time-zone expression.
      Specified by:
      currentTimestampWithTimeZone in interface CurrentTemporalSupport
    • 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 Dialect
      See Also:
    • extractPattern

      @SPI({USE,IMPLEMENT}) public String extractPattern(TemporalUnit unit)
      In H2, the extract() function does not return fractional seconds for the field TemporalUnit.SECOND. We work around this here with two calls to extract().
      Specified by:
      extractPattern in interface TemporalOperationSupport
    • 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 Dialect
      Parameters:
      from - a CastType indicating the type of the value argument
      to - a CastType indicating the type the value argument is cast to
    • timestampaddPattern

      @SPI({USE,IMPLEMENT}) public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType)
      Description copied from interface: TemporalOperationSupport
      Return a timestamp-add pattern containing ?1, ?2, and ?3.
      Specified by:
      timestampaddPattern in interface TemporalOperationSupport
    • timestampdiffPattern

      @SPI({USE,IMPLEMENT}) public String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType)
      Description copied from interface: TemporalOperationSupport
      Return a timestamp-difference pattern containing ?1, ?2, and ?3.
      Specified by:
      timestampdiffPattern in interface TemporalOperationSupport
    • appendDateTimeLiteral

      @SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone)
      Description copied from class: Dialect

      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
      Overrides:
      appendDateTimeLiteral in class Dialect
    • appendDateTimeLiteral

      @SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone)
      Description copied from class: Dialect

      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
      Overrides:
      appendDateTimeLiteral in class Dialect
    • appendDateTimeLiteral

      @SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone)
      Description copied from class: Dialect

      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
      Overrides:
      appendDateTimeLiteral in class Dialect
    • supportsTimeLiteralOffset

      public boolean supportsTimeLiteralOffset()
    • 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 Dialect
      See Also:
    • getTimeZoneSupport

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

      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.

      Overrides:
      getTimeZoneSupport in class Dialect
      Returns:
      the database time-zone type support profile
      See Also:
    • getPredicateSupport

      public PredicateSupport getPredicateSupport()
      Description copied from class: Dialect

      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.

      Overrides:
      getPredicateSupport in class Dialect
      Returns:
      this Dialect's stable predicate-support profile
    • appendBooleanValueString

      @SPI({USE,IMPLEMENT}) public void appendBooleanValueString(SqlAppender appender, boolean bool)
      Description copied from interface: LiteralSupport
      Append a SQL Boolean literal expression.
      Specified by:
      appendBooleanValueString in interface LiteralSupport
    • getLimitHandler

      public LimitHandler getLimitHandler()
      Description copied from class: Dialect

      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.

      Overrides:
      getLimitHandler in class Dialect
      Returns:
      a non-null handler
    • 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 Dialect
      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 Dialect
      See Also:
    • alterColumnType

      @SPI({USE,IMPLEMENT}) public String alterColumnType(AlterColumnTypeRequest request)
      Specified by:
      alterColumnType in interface AlterTableSupport
    • getSchemaCommentSupport

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

      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.

      Overrides:
      getSchemaCommentSupport in class Dialect
      See Also:
    • getSchemaDropSupport

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

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

      Return one immutable profile for this Dialect's lifetime.

      Overrides:
      getSchemaDropSupport in class Dialect
      See Also:
    • getSequenceSupport

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

      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.

      Overrides:
      getSequenceSupport in class Dialect
      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:
    • getNullOrderingSupport

      public NullOrderingSupport getNullOrderingSupport()
      Description copied from class: Dialect

      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 Dialect.getNullOrderingSupport() from the superclass and change only the values which differ.

      Overrides:
      getNullOrderingSupport in class Dialect
      Returns:
      the stable, non-null null-ordering-support profile
    • getMultiTableMutationSupport

      public MultiTableMutationSupport getMultiTableMutationSupport()
      Description copied from class: Dialect

      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.

      Overrides:
      getMultiTableMutationSupport in class Dialect
      Returns:
      a stable, non-null fallback selection profile
    • getGlobalTemporaryTableStrategy

      public TemporaryTableStrategy getGlobalTemporaryTableStrategy()
      Description copied from class: Dialect

      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 Dialect.getTemporaryTableExporter().

      Overrides:
      getGlobalTemporaryTableStrategy in class Dialect
    • getLocalTemporaryTableStrategy

      public TemporaryTableStrategy getLocalTemporaryTableStrategy()
      Description copied from class: Dialect

      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 Dialect.getTemporaryTableExporter().

      Overrides:
      getLocalTemporaryTableStrategy in class Dialect
    • 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 Dialect
      Returns:
      the non-null constraint-name extractor
      See Also:
    • causesRollback

      public boolean causesRollback(SQLException sqlException)
      Description copied from class: Dialect

      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.

      Overrides:
      causesRollback in class Dialect
      Parameters:
      sqlException - the original database exception
      Returns:
      true when the failed statement invalidates the transaction
    • 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 Dialect
      Returns:
      the vendor conversion delegate, or null when none is supplied
      See Also:
    • getCurrentTimestampSelection

      @SPI({USE,IMPLEMENT}) public CurrentTimestampSelection getCurrentTimestampSelection()
      Description copied from interface: CurrentTemporalSupport
      Select the JDBC command used for database-side current timestamp retrieval, or return null when the database offers no supported command.
      Specified by:
      getCurrentTimestampSelection in interface CurrentTemporalSupport
      See Also:
    • isCurrentTimestampStable

      @SPI({USE,IMPLEMENT}) public boolean isCurrentTimestampStable()
      Description copied from interface: CurrentTemporalSupport
      Whether the current timestamp remains stable throughout a transaction.
      Specified by:
      isCurrentTimestampStable in interface CurrentTemporalSupport
    • getTupleCountSupport

      public TupleCountSupport getTupleCountSupport()
      Description copied from class: Dialect

      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 Dialect.getTupleCountSupport() from the superclass and replace only the differing syntax choice.

      Overrides:
      getTupleCountSupport in class Dialect
      Returns:
      the non-null tuple-count-syntax 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 Dialect
      Returns:
      this Dialect's stable subquery-support profile
    • 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 Dialect
      Returns:
      this Dialect's stable window-function-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 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 Dialect
      Returns:
      this Dialect's stable set-operation profile
    • getFetchClauseSupport

      @SPI({USE,IMPLEMENT,SUPPLY}) public FetchClauseSupport getFetchClauseSupport()
      Description copied from class: Dialect

      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.

      Overrides:
      getFetchClauseSupport in class Dialect
      Returns:
      the stable fetch clause capability profile
      See Also:
    • 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 Dialect
      Returns:
      a non-null immutable capability profile
      See Also:
    • 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 Dialect
    • 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 because we can use select ... from final table (insert .... )
    • getQueryHintString

      @SPI({USE,IMPLEMENT}) public String getQueryHintString(String query, String hints)
      Description copied from class: Dialect
      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.

      Overrides:
      getQueryHintString in class Dialect
      Parameters:
      query - The query to which to apply the hint.
      hints - The hints to apply
      Returns:
      The modified SQL
    • appendFormat

      @SPI({USE,IMPLEMENT}) public void appendFormat(SqlAppender appender, String format)
      Description copied from interface: TemporalFormatSupport
      Append the database translation of the supplied Hibernate format pattern.
      Specified by:
      appendFormat in interface TemporalFormatSupport
    • translateExtractField

      @SPI({USE,IMPLEMENT}) public String translateExtractField(TemporalUnit unit)
      Description copied from interface: TemporalOperationSupport
      Translate an extraction field name.
      Specified by:
      translateExtractField in interface TemporalOperationSupport
    • appendDefinition

      @SPI({USE,IMPLEMENT}) public void appendDefinition(SqlAppender appender, ColumnDefinitionRequest request)
      Specified by:
      appendDefinition in interface ColumnDefinitionSupport
    • constraintControlMode

      @SPI({USE,IMPLEMENT}) public ConstraintControlMode constraintControlMode()
      Specified by:
      constraintControlMode in interface ConstraintControlSupport
      Overrides:
      constraintControlMode in class Dialect
    • enableCommands

      @SPI({USE,IMPLEMENT}) public List<String> enableCommands()
      Specified by:
      enableCommands in interface ConstraintControlSupport
    • getEnumSupport

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

      @SPI({USE,IMPLEMENT}) public List<String> disableCommands()
      Specified by:
      disableCommands in interface ConstraintControlSupport
    • getUniqueDelegate

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

      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.

      Overrides:
      getUniqueDelegate in class Dialect
      See Also:
    • getRowIdSupport

      @SPI({IMPLEMENT,SUPPLY}) public RowIdSupport getRowIdSupport()
      Description copied from class: Dialect
      Supply the database's row-locator expression, JDBC type, and optional physical-column declaration policy.
      Overrides:
      getRowIdSupport in class Dialect
      Returns:
      the stable non-null row-id strategy
      See Also:
    • 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 Dialect
      Returns:
      a non-null operation for the supplied optional-table update
      See Also:
    • getNativeParameterMarkerStrategy

      @SPI({USE,IMPLEMENT,SUPPLY}) public ParameterMarkerStrategy getNativeParameterMarkerStrategy()
      Description copied from class: Dialect

      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.

      Overrides:
      getNativeParameterMarkerStrategy in class Dialect
      Returns:
      the native strategy, or null for JDBC-standard markers
      See Also:
    • getDmlTargetColumnQualifierSupport

      @SPI({USE,IMPLEMENT,SUPPLY}) public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport()
      Description copied from class: Dialect

      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.

      Overrides:
      getDmlTargetColumnQualifierSupport in class Dialect
      Returns:
      the non-null target-column qualifier support
      See Also:
    • getObjectNullBindingStrategy

      @SPI({IMPLEMENT,SUPPLY}) public ObjectNullBindingStrategy getObjectNullBindingStrategy()
      Description copied from class: Dialect
      Supply the JDBC strategy for binding an untyped Java null.
      Overrides:
      getObjectNullBindingStrategy in class Dialect
      Returns:
      the non-null binding strategy
      See Also:
    • getValuesListSupport

      public ValuesListSupport getValuesListSupport()
      Description copied from class: Dialect

      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.

      Overrides:
      getValuesListSupport in class Dialect
    • getSingleRowTableSupport

      public SingleRowTableSupport getSingleRowTableSupport()
      Description copied from class: Dialect

      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 Dialect.getSingleRowTableSupport() from the superclass and change only the values which differ.

      Overrides:
      getSingleRowTableSupport in class Dialect
      Returns:
      the stable, non-null single-row-table-support profile
    • supportsFilterClause

      public boolean supportsFilterClause()
      Description copied from class: Dialect

      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.

      Overrides:
      supportsFilterClause in class Dialect
    • getRowValueSupport

      public RowValueSupport getRowValueSupport()
      Description copied from class: Dialect

      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.

      Overrides:
      getRowValueSupport in class Dialect
      Returns:
      this Dialect's stable row-value-support profile
    • getNamespaceSupport

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

      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.

      Overrides:
      getNamespaceSupport in class Dialect
      See Also: