Class 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
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:
columnType(int)to define a mapping from SQL type codes to database column types, andinitializeFunctionRegistry(FunctionContributions)to register mappings for standard HQL functions with theSqmFunctionRegistry.
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final LobMergeStrategyALobMergeStrategyrepresenting the legacy behavior of Hibernate.protected static final LobMergeStrategyALobMergeStrategybased on creating a new LOB locator.protected final MultiKeyLoadSizingStrategyprotected static final LobMergeStrategyALobMergeStrategybased on transferring contents using streams.Fields inherited from interface ConstraintControlSupport
NONEFields inherited from interface TruncateSupport
STANDARD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDialect(DatabaseVersion version) protectedDialect(DialectResolutionInfo info) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether every table partition key must also occur in its primary key.voidappendArrayLiteral(SqlAppender appender, Object[] literal, JdbcLiteralFormatter<Object> elementFormatter, WrapperOptions wrapperOptions) Append an array literal using this Dialect's standard array support.voidappendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal for ajava.timevalue.voidappendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal for aCalendarvalue.voidappendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal for a legacyDatevalue.voidaugmentPhysicalTableTypes(List<String> tableTypesList) Append database-specific physical table types totableTypesList.voidaugmentRecognizedTableTypes(List<String> tableTypesList) Append database-specific recognized table types totableTypesList.protected LockingClauseStrategybuildLockingClauseStrategy(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.Supplies vendor-specific SQL-exception conversion for this Dialect.protected final StringbuildStringToBooleanCast(String trueValue, String falseValue) Build the complete portable string-to-Boolean cast expression using the supplied SQL fragments for the true and false results.protected final StringbuildStringToBooleanCastDecode(String trueValue, String falseValue) Build the complete string-to-Boolean cast expression using the databasedecodefunction and the supplied SQL fragments for true and false.castPattern(CastType from, CastType to) Obtain a pattern for the SQL equivalent to acast()function call.protected StringcastType(int sqlTypeCode) Return the complete cast-target type pattern forsqlTypeCode.booleancausesRollback(SQLException sqlException) Determine whether this database marks the current transaction for rollback after the given statement failure.protected StringcolumnType(int sqlTypeCode) protected voidcontributeDefaultProperties(Properties properties) Contribute provider configuration defaults after Dialect construction.protected voidcontributeKeywords(KeywordRegistration registration) Contribute ANSI and database-specific SQL keywords.voidcontributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Contribute database-specific Java, JDBC, DDL, and basic type descriptors.Creates the JDBC mutation operation for an optional-table update.A defaultScrollModeto be used byQuery.scroll().Determine the database version, as precise as possible and using Dialect-specific techniques, from aDialectResolutionInfoobject.booleanequivalentTypes(int typeCode1, int typeCode2) Determine directional compatibility of two JDBC or extended SQL type codes.Supply the aggregate-column mapping, DDL, read, assignment, and write behavior for this dialect.Supply alter-table and add-column grammar.The independent array syntax and multi-valued parameter-binding behavior of this Dialect.getArrayTypeName(String javaElementTypeName, String elementTypeName, Integer maxLength) Render an array type name from the independent Java element name, rendered SQL element name, and optional maximum length.The strategy used to determine the appropriate number of keys to load in a single SQL query with batch-fetch loading.Supply the callable-statement protocol for this database and JDBC driver.Supply the catalog separator used when JDBC metadata is unavailable.Supply this Dialect's check-constraint placement and rendering strategy.Supplies the strategy used to extract projected column aliases from JDBC result-set metadata during native-query auto-discovery.Supply non-identity column-definition composition.Supply the strategy for controlling constraints during table cleaning.The common-table-expression capabilities of this Dialect.Supply current temporal expressions and database-side timestamp retrieval.Supplies the preferred default ordinality-column name for a set-returning function.Retrieve a defensive copy of the completed configuration defaults.Supply direct JDBC access capabilities for Java Time classes.The qualifier form accepted for target-column references in update and delete statements.The stable factory which creates executable entity-locking strategies for this Dialect.Supply the database's finite-domain declaration, lifecycle, and check strategy.Supplies the expression-coercion adaptations required by this database.Supply thefetchclause forms accepted by this database.Supply the exporter used to create and drop foreign-key constraints.Supply this Dialect's foreign-key DDL and delete-semantics strategy.The database's support for recognizing primary-key functional dependency ingroup byandorder byclauses.Supply the stable profile describing immediate retrieval of arbitrary database-generated values for this Dialect.Supplies this Dialect's global temporary-table strategy.Supply identifier quoting, limits, and helper construction.Supply the stable identity-column DDL, insert syntax, and identity-specific retrieval behavior for this Dialect.Supply existence-check placement for schema DDL targets.Supply index creation grammar and name qualification policy.Supply the exporter used to create and drop relational indexes.getInformationExtractor(ExtractionContext extractionContext) Supply the context-bound strategy Hibernate uses to discover database tables, keys, indexes, and related schema metadata.Supply the stable overrides applied to raw JDBC metadata reports.Return the immutable ANSI and Dialect-defined keyword profile.Supply the stable Dialect keyword profile and JDBC-keyword filter.Supplies execution-time pagination for already-rendered SQL requested byQuery.setMaxResults(int)orQuery.setFirstResult(int).Supply SQL literal rendering.Get theLobMergeStrategyto use,NEW_LOCATOR_LOB_MERGE_STRATEGYby default.Supply the database and driver policy for LOB creation, binding, materialization, type classification, mutation ordering, and VALUE LOB DDL.Supplies this Dialect's local temporary-table strategy.getLockingClauseStrategy(QuerySpec querySpec, LockOptions lockOptions) Supplies the per-translation strategy for a statement-level [PessimisticLockStyle#CLAUSE locking clause].Supplies the cohesive pessimistic-locking profile for this Dialect.The unquoted SQL function name which transforms a string to lowercase.protected DatabaseVersionGet the version of the SQL dialect that is the minimum supported by this implementation.The strategy used to determine the appropriate number of keys to load in a single SQL query with multi-key loading.Select the Hibernate-owned fallback families used for SQM update/delete and insert operations targeting entities mapped to multiple tables.The native SQL mutation-syntax capabilities of this Dialect.Supply catalog and schema qualification support, or returnnullto useDatabaseMetaData.Supply catalog and schema lifecycle behavior to schema tooling.Describe how this database represents nationalized character data.Supply the native parameter-marker strategy selected for this database and JDBC driver.Supply the semantic identifier-generation type used for native generation.Supply the database's default null ordering and explicit null-precedence syntax capabilities.Supply the JDBC strategy for binding an untyped Javanull.Supplies the database limits forIN-expression elements and total JDBC statement parameters.Supplies the fallback persistent-table strategy used when no native local or global temporary-table strategy is selected.The database's native predicate syntax and predicate-placement profile.intSelect the defaultSqlTypescode for a basic Java array or collection.intSelect the defaultSqlTypescode for Javabooleanmappings.Supply the final placement of a leading database hint relative to a user SQL comment.getQueryHintString(String query, String hints) Apply a hint to the given SQL query.getQueryHintString(String query, List<String> hintList) Apply a hint to the given SQL query.Supply the stable factory which creates this Dialect's JDBC REF_CURSOR registration and extraction service.Supply the database's row-locator expression, JDBC type, and optional physical-column declaration policy.Supplies the complete database-native row-level-security strategy for this Dialect.The native row-value syntax of this Dialect.Supply schema-export support for comments attached to database objects.Supply schema-drop composition and ordered pre-drop commands.Supply the strategy which resolves the current schema for a JDBC connection.getSelectClauseNullString(SqlTypedMapping sqlTypeMapping, TypeConfiguration typeConfiguration) Render the complete typed-null select-item expression for one arm of a union query.Supply the exporter used to create and drop relational sequences.Supply the strategy Hibernate uses to discover existing database sequences and their metadata.Supplies the complete sequence value-expression and lifecycle-DDL strategy for this Dialect.Supplies the database's set operators and structural query-group capabilities.getSetOperatorSqlString(SetOperator operator) Get the SQL string representation for a specific set operator (UNION, INTERSECT, EXCEPT).Supply the SQL renderings used for a reusable single-row table and for an otherwise table-less select.Supply the strategy which resolves column sizes for mapped Java and JDBC types.Supply the factory for this Dialect's single-use SQL AST translators.Supply the database's stable string-value semantics.Supplies the database's supported subquery placements.Supply the strategy for synthetic table roots required while converting grouping and ordering expressions to SQL AST.Supply the strategy which produces complete table-cleaning commands.Supply table and view creation grammar.Supply the exporter used to create and drop relational tables.Supply the strategy which migrates relational table definitions.Supply datetime-format translation.Supply extraction and timestamp-arithmetic syntax.Supplies the complete temporal-table DDL and historical-query strategy for this Dialect.Supply temporal precision-adjustment and literal-offset semantics.Supplies the runtime DDL exporter for temporary-table descriptors.Select the database's support profile for SQLwith time zonetypes.Supply ordered table-truncation commands.Supplies the database syntax for ordinary and distinct tuple counts.Supplies this Dialect's resolved type-sizing limits and defaults.Supply the stable strategy used for unique-key representation and DDL.Supply the exporter used to create and drop user-defined types.The contexts in which this Dialect supports native multi-rowvaluessyntax.final DatabaseVersionGet the version of the SQL dialect that is the target of this instance.Supplies the extractor used to recover violated constraint names from database exceptions.Supplies the native window-function syntax supported by this database.voidinitializeFunctionRegistry(FunctionContributions functionContributions) Contribute the database-specific function descriptors after independent function contributors have run.booleanIs JDBC statement warning logging enabled by default?protected StringnarrowCastType(int sqlTypeCode) Return the complete type pattern for a cast or set-returning-function declaration position which rejects locator LOB names.protected voidregisterColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Register the inherited ANSI-oriented DDL type descriptors during Dialect type contribution.protected IntegerresolveSqlTypeCode(String typeName, String baseTypeName, TypeConfiguration typeConfiguration) Resolve a database-reported type using both its complete and normalized base names.protected IntegerresolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration) Resolve a database-reported type name before base-name extraction.resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Resolve the non-null JDBC descriptor for result-set metadata.intresolveSqlTypeLength(String columnTypeName, int jdbcTypeCode, int precision, int scale, int displaySize) Normalize JDBC result-set metadata to Hibernate's resolved column length.booleanWhether this database supports ANSIcross joinsyntax.booleanWhether this database supports native aggregatefilter (where ...)syntax.booleanDetermine whether the JDBC driver correctly implements the nationalizedResultSet,PreparedStatement, andCallableStatementmethods.booleanDetermine whether query clauses may refer to select items by their one-based ordinal position.booleanWhether mapped aggregate structures may be represented as database user-defined types.booleanDeprecated, 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.final StringtoString()trimPattern(TrimSpec specification, boolean isWhitespace) Obtain a pattern for the SQL equivalent to atrim()function call.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AlterTableSupport
addColumnPrefix, addColumnSuffix, alterColumnType, alterTableCommandMethods inherited from interface CheckConstraintSupport
render, supportsMethods inherited from interface ColumnDefinitionSupport
appendDefinitionMethods inherited from interface ConstraintControlSupport
disableCommands, disableConstraintCommands, enableCommands, enableConstraintCommandsMethods inherited from interface ForeignKeySupport
renderAddConstraint, renderDropConstraint, requiresSelfReferentialForeignKeyNullification, supportsAlterTableConstraints, supportsOnDeleteActionMethods inherited from interface IdentifierSupport
buildIdentifierHelper, closeQuote, getMaxAliasLength, getMaxIdentifierLength, openQuote, quote, quoteCollation, toQuotedIdentifierMethods inherited from interface IndexDdlSupport
createCommand, createTail, nameQualificationMethods inherited from interface KeywordSupport
acceptsJdbcKeywordMethods inherited from interface LiteralSupport
appendBinaryLiteral, appendBooleanValueString, appendIntervalLiteral, appendIntervalLiteral, appendLiteral, appendUUIDLiteral, toBooleanValueStringMethods inherited from interface TableCreationSupport
createTableCommand, requiresViewColumnList, tableCreationOptionsMethods inherited from interface TemporalOperationSupport
extractPattern, fractionalSecondPrecisionInNanos, timestampaddPattern, timestampdiffPattern, translateDurationField, translateExtractFieldMethods inherited from interface TruncateSupport
renderCommands
-
Field Details
-
LEGACY_LOB_MERGE_STRATEGY
ALobMergeStrategyrepresenting the legacy behavior of Hibernate. LOBs are not processed by merge. -
STREAM_XFER_LOB_MERGE_STRATEGY
ALobMergeStrategybased on transferring contents using streams. -
NEW_LOCATOR_LOB_MERGE_STRATEGY
ALobMergeStrategybased on creating a new LOB locator. -
STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY
-
-
Constructor Details
-
Dialect
-
Dialect
-
-
Method Details
-
determineDatabaseVersion
Determine the database version, as precise as possible and using Dialect-specific techniques, from aDialectResolutionInfoobject.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
Contribute provider configuration defaults after Dialect construction.
Invoke
superfirst to extend the inherited defaults. Omittingsuperdeliberately replaces them. Mutate the supplied isolated property bag only during this callback; do not retain it or callgetDefaultProperties()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
superfirst to retain the inherited descriptor set; omitting it deliberately replaces that set. Mutate the supplied boot-scoped registry only during this callback, and do not retain the contribution context or registry afterward. Implement an independentTypeContributorinstead when the contribution is not owned by a Dialect.- Parameters:
typeContributions- the Hibernate-supplied contribution targetserviceRegistry- the Hibernate-supplied bootstrap services- Since:
- 8.0
- See Also:
-
columnType
Return the complete database column declaration pattern for a JDBC
Typesor HibernateSqlTypescode used during type registration.Use only
$l,$p, and$sfor length, precision, and scale. Define distinct mappings for theLONG32codes; the JDBCLONGsynonyms are normalized before this hook. Delegate unknown inherited codes to the superclass so its standard exception remains authoritative. -
castType
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
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
LONG32LOB codes to the corresponding varying type and delegates every other code tocolumnType(int).- Since:
- 7.4
-
contributeKeywords
Contribute ANSI and database-specific SQL keywords.
Invoke
superfirst to retain the SQL:2003 words. Omittingsuperdeliberately 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
Get the version of the SQL dialect that is the target of this instance. -
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.
columnTypeNameis complete and may include parameters or an array suffix. Return null when it cannot be resolved. -
resolveSqlTypeCode
-
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
precisionmay represent character length. Providers should retain their vendor formulas using all supplied metadata values. -
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
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
superfirst to retain Hibernate's standard and emulated registrations; omitting it deliberately replaces that set. Mutate the supplied boot-scoped function registry only during this callback, and do not retain the contribution context or registry afterward. Implement an independentFunctionContributorinstead when the contribution is not owned by a Dialect.- Parameters:
functionContributions- the Hibernate-supplied function contribution target- Since:
- 8.0
- See Also:
-
castPattern
Obtain a pattern for the SQL equivalent to acast()function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments. -
buildStringToBooleanCast
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, and0, compared in lowercase. Null or unrecognized input produces null. Providers should call this final helper fromcastPattern(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
decodefunction 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 fromcastPattern(CastType, CastType)whendecodeis the appropriate native rendering. -
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-onlyfromfragment are independent; an empty fragment means that nofromclause is required. Dialect subclasses refining a family profile should copygetSingleRowTableSupport()from the superclass and change only the values which differ.- Returns:
- the stable, non-null single-row-table-support profile
- Since:
- 8.0
-
trimPattern
Obtain a pattern for the SQL equivalent to atrim()function call. The resulting pattern must contain a ?1 placeholder for the argument of typeStringand a ?2 placeholder for the trim character ifisWhitespacewas false. -
equivalentTypes
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
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
-
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
superfirst unless the Dialect intentionally replaces the complete inherited contribution protocol. Obtain reusable dialect-specific JDBC descriptors from the family facades inorg.hibernate.dialect.type.spi, and preserve whether a descriptor replaces an existing registration or is added only when absent.- Parameters:
typeContributions- the Hibernate-supplied contribution registryserviceRegistry-the Hibernate-supplied services, including class loading used by driver-backed descriptor factories
Mutate the supplied boot-scoped registries only during this callback and do not retain the contribution context or a mutable registry afterward. Implement an independent
TypeContributorinstead when the contribution is not owned by a Dialect.- Since:
- 8.0
-
getLobMergeStrategy
Get theLobMergeStrategyto use,NEW_LOCATOR_LOB_MERGE_STRATEGYby default. -
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.IDENTITYwhen this Dialect'sIdentityColumnSupportsupports identity columns andGenerationType.SEQUENCEotherwise. Override it when the database's native choice differs from that rule.Legacy
"native"mappings andNativeGeneratorconsume this same provider decision.- Returns:
- the non-null semantic native identifier-generation type
- Since:
- 7.0
- See Also:
-
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 extendingIdentityColumnSupportBaseand 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
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 ofSequenceSupport.- 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
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 withSequenceInformationExtractors.builder(String), and implementSequenceInformationExtractordirectly 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 fromInformationExtractors, and implementInformationExtractordirectly only when none of those complete profiles matches the database.- Since:
- 7.2
- See Also:
-
getLimitHandler
Supplies execution-time pagination for already-rendered SQL requested by
Query.setMaxResults(int)orQuery.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 stockLimitHandleror 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
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
The stable factory which creates executable entity-locking strategies for this Dialect.
Override this method to select a stock profile from
EntityLockingStrategiesor 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
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
CTErequires 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_STRATEGYorQuerySettings.QUERY_MULTI_TABLE_INSERT_STRATEGYinstead of depending on Hibernate's internal fallback implementations.- Returns:
- a stable, non-null fallback selection profile
- Since:
- 8.0
-
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
Supply current temporal expressions and database-side timestamp retrieval. Return one stable, non-null, thread-safe implementation. Providers may implementCurrentTemporalSupportdirectly and returnthis.- Since:
- 8.0
- See Also:
-
getTemporalFormatSupport
Supply datetime-format translation. Return one stable, non-null, thread-safe implementation.- Since:
- 8.0
- See Also:
-
getTemporalOperationSupport
Supply extraction and timestamp-arithmetic syntax. Return one stable, non-null, thread-safe implementation. Providers may implementTemporalOperationSupportdirectly and returnthis.- Since:
- 8.0
- See Also:
-
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
nullresult means that it declined the exception so conversion may continue. Returnnullfrom this method when the Dialect has no vendor-specific delegate.Prefer stable vendor error codes or SQL states and preserve the original
SQLException.- Returns:
- the vendor conversion delegate, or
nullwhen 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
nullwhen a name cannot be recovered. Do not use an empty string or sentinel to represent absence.- Specified by:
getViolatedConstraintNameExtractorin interfaceConversionContext- 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 itemtypeConfiguration- the active type configuration- Returns:
- the complete select-item expression
-
getSetOperatorSqlString
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
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
The database's native predicate syntax and predicate-placement profile.
Override this method to supply independent support for a native case-insensitive-
likeoperator, scalardistinct from, truthness predicates, and predicates used as value expressions. An absent case-insensitive-likeoperator 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
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-valuedINlists, row-valuedINsubqueries, and quantified row comparisons. Treat each feature as an exact native-syntax declaration: do not inferIN-subquery support fromIN-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
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
SetOperatorindependently; support for a distinct operator never implies itsALLform. Structural capabilities such asUNIONplacement in subqueries are separate from operator support. Continue to overridegetSetOperatorSqlString(SetOperator)when an operator requires database-specific spelling. When refining a family Dialect, start fromSetOperationSupport.builder(super.getSetOperationSupport())and change only the differing values.- Returns:
- this Dialect's stable set-operation profile
- Since:
- 8.0
-
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
existspredicates in the select list are separate capabilities. Lateral spelling and fallback rendering remain translator responsibilities. When refining a family Dialect, start fromSubquerySupport.builder(super.getSubquerySupport())and change only the differing placements.- Returns:
- this Dialect's stable subquery-support profile
- Since:
- 8.0
-
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
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
Supply identifier quoting, limits, and helper construction.
Return one stable, non-null strategy for this Dialect's lifetime.
- Since:
- 8.0
- See Also:
-
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
Return the immutable ANSI and Dialect-defined keyword profile.- Specified by:
getKeywordsin interfaceKeywordSupport
-
getLiteralSupport
Supply SQL literal rendering.
Return one stable, non-null strategy for this Dialect's lifetime.
- Since:
- 8.0
- See Also:
-
getIfExistsSupport
Supply existence-check placement for schema DDL targets.
Return one immutable profile for this Dialect's lifetime.
- Since:
- 8.0
- See Also:
-
getAlterTableSupport
Supply alter-table and add-column grammar.
Return a stable strategy and do not retain
AlterColumnTypeRequestinstances. A Dialect may implementAlterTableSupportdirectly and return itself so subclass overrides retain ordinary Java dispatch.- Since:
- 8.0
- See Also:
-
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
Supply non-identity column-definition composition.
Consume rendered request values without retaining mapping or call-scoped state.
- Since:
- 8.0
- See Also:
-
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
Supply the strategy for controlling constraints during table cleaning.
Implement only the command family selected by
ConstraintControlSupport.constraintControlMode().- Since:
- 8.0
- See Also:
-
constraintControlMode
- Specified by:
constraintControlModein interfaceConstraintControlSupport
-
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
- Specified by:
truncateModein interfaceTruncateSupport
-
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
-
getTableMigrator
Supply the strategy which migrates relational table definitions.
Return one stable migrator for this Dialect's lifetime.
- Since:
- 8.0
- See Also:
-
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
Supply the exporter used to create and drop user-defined types.
Return one stable exporter owned by this Dialect. Use
StandardUserDefinedTypeExporterwhen standard object-type DDL is sufficient. -
getSequenceExporter
-
getIndexExporter
-
getForeignKeyExporter
Supply the exporter used to create and drop foreign-key constraints.
Return one stable exporter owned by this Dialect. Compose
StandardForeignKeyExporterwhen the database decorates otherwise standard foreign-key DDL. -
getTemporaryTableExporter
Supplies the runtime DDL exporter for temporary-table descriptors.
The exporter must agree with the
TemporaryTableStrategyinstances supplied by this Dialect. PreferStandardTemporaryTableExporterunless the database requires a different assembly of table or column fragments. The returned exporter must be non-null and safe for reuse. -
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
Supplies this Dialect's local temporary-table strategy.
Return
nullwhen the database has no supported local temporary-table form. A non-null strategy must be stable for the Dialect lifetime and consistent withgetTemporaryTableExporter().- Since:
- 7.1
-
getGlobalTemporaryTableStrategy
Supplies this Dialect's global temporary-table strategy.
Return
nullwhen the database has no supported global temporary-table form. A non-null strategy must be stable for the Dialect lifetime and consistent withgetTemporaryTableExporter().- Since:
- 7.1
-
getNamespaceSupport
Supply catalog and schema lifecycle behavior to schema tooling.
Return one stable, non-null strategy. Prefer a complete immutable profile from
NamespaceSupports, and implementNamespaceSupportdirectly only for custom or multi-command namespace SQL.- Since:
- 8.0
- See Also:
-
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
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
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
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
Supplies the strategy used to extract projected column aliases from JDBC result-set metadata during native-query auto-discovery.
Return
ColumnAliasExtractor.COLUMN_LABEL_EXTRACTORunless the JDBC driver requires extraction throughResultSetMetaData.getColumnName(int). The returned strategy must be stable and thread-safe.- Returns:
- the non-null alias extractor
- Since:
- 8.0
- See Also:
-
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
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:
truewhen ordinal select-item references are supported- Since:
- 8.0
-
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 rendernulls firstandnulls lastnatively. Dialect subclasses refining a family profile should copygetNullOrderingSupport()from the superclass and change only the values which differ.- Returns:
- the stable, non-null null-ordering-support profile
- Since:
- 8.0
-
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.UNSUPPORTEDto use Hibernate's existing emulation,TupleCountSupport.Syntax.ARGUMENT_LISTfor syntax such ascount(a, b), orTupleCountSupport.Syntax.PARENTHESIZED_TUPLEfor syntax such ascount((a, b)). Configure the ordinary and distinct forms independently; a database may require different forms for them. When refining a family Dialect, copygetTupleCountSupport()from the superclass and replace only the differing syntax choice.- Returns:
- the non-null tuple-count-syntax profile
- Since:
- 8.0
-
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.UNLIMITEDwhen neither limit applies andParameterLimits.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
Supply the database's stable string-value semantics.- Returns:
- the non-null string-value profile
- Since:
- 8.0
- See Also:
-
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.internalleaf.- Since:
- 8.0
- See Also:
-
getQueryHintString
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
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
Supply the final placement of a leading database hint relative to a user SQL comment.
Return one stable value. Select
BEFORE_COMMENTonly when the database requires its hint to be the first leading SQL comment.- Since:
- 8.0
- See Also:
-
defaultScrollMode
A defaultScrollModeto be used byQuery.scroll().- Returns:
- the default
ScrollModeto use. - API Note:
- Certain dialects support a subset of
ScrollModes.
-
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
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
REPORTEDto retain Hibernate's interpreted driver answer, and forceSUPPORTEDorUNSUPPORTEDonly 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
Supply the
fetchclause 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
fetchclause capability profile - Since:
- 8.0
- See Also:
-
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
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
CallableStatementSupportsfor the standard and stock database protocols.- Returns:
- the callable-statement strategy
- Since:
- 8.0
- See Also:
-
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
Supply catalog and schema qualification support, or return
nullto useDatabaseMetaData.This value does not define the catalog separator; override
getCatalogSeparator()independently when the metadata-free fallback is not..- See Also:
-
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
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
-
augmentPhysicalTableTypes
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
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
Whether every table partition key must also occur in its primary key.
Return
trueonly 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
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
Determine whether the JDBC driver correctly implements the nationalized
ResultSet,PreparedStatement, andCallableStatementmethods.This driver capability is independent of the database SQL-type semantics described by
getNationalizationSupport(). A provider should returnfalsewhen the driver requires the ordinary character methods even if the database supports explicit nationalized types.- Returns:
truewhen nationalized JDBC access methods may be used- Since:
- 8.0
- See Also:
-
getAggregateSupport
Supply the aggregate-column mapping, DDL, read, assignment, and write behavior for this dialect. Override this method to return a provider implementation ofAggregateSupport, or retain the standard behavior returned by the default.- Returns:
- this dialect's aggregate support
- Since:
- 8.0
- See Also:
-
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
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 arrayandelement 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:
appendArrayLiteralin interfaceLiteralSupport
-
getPreferredSqlTypeCodeForArray
Select the default
SqlTypescode 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, andSqlTypes.VARBINARY. Thehibernate.type.preferred_array_jdbc_typesetting 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
Select the default
SqlTypescode for Javabooleanmappings.Return a Boolean-compatible code such as
SqlTypes.BOOLEAN,SqlTypes.BIT,SqlTypes.SMALLINT,SqlTypes.TINYINT, orSqlTypes.INTEGER. Thehibernate.type.preferred_boolean_jdbc_typesetting 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
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; invokingsuperis not required. This method is called only after Dialect construction, has no corresponding shutdown lifecycle, and failures propagate to the operation which obtains the profile. -
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.
QueryMutationRenderingSupportconsumes this profile when selecting a native or emulated plan. -
getValuesListSupport
The contexts in which this Dialect supports native multi-row
valuessyntax.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
Supply the factory for this Dialect's single-use SQL AST translators.
Return
nullto useStandardSqlAstTranslatorFactory. A custom Dialect should normally return a reusable factory derived from that class and create translators derived fromAbstractSqlAstTranslatoror an appropriate supported family base. The factory must not retain translation requests, and every translator it returns is used for one translation.- See Also:
-
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
StandardSizeStrategywith 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
Supplies this Dialect's resolved type-sizing limits and defaults.
Return
TypeSizingProfile.STANDARDwhen 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
Supply the native parameter-marker strategy selected for this database and JDBC driver.
Return
nullto 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
nullfor JDBC-standard markers - See Also:
-
getDefaultOrdinalityColumnName
Supplies the preferred default ordinality-column name for a set-returning function.
Return a stable, unqualified SQL column name, or
nullwhen the database does not define a preferred name. Hibernate usesias 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
nullto use Hibernate's fallback - Since:
- 8.0
-
causesRollback
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
PessimisticLockExceptionorLockTimeoutException.- Parameters:
sqlException- the original database exception- Returns:
truewhen 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.timevalue.Preserve the value's offset only when the Dialect's temporal-value semantics permit it. Append immediately and retain no invocation state.
- Specified by:
appendDateTimeLiteralin interfaceLiteralSupport
-
appendDateTimeLiteral
@SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal for a legacy
Datevalue.Apply the supplied JDBC time zone where required, append immediately, and retain no invocation state.
- Specified by:
appendDateTimeLiteralin interfaceLiteralSupport
-
appendDateTimeLiteral
@SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal for a
Calendarvalue.Preserve Calendar-specific time-zone and millisecond semantics, append immediately, and retain no invocation state.
- Specified by:
appendDateTimeLiteralin interfaceLiteralSupport
-
getTimeZoneSupport
Select the database's support profile for SQL
with time zonetypes.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
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 byandorder byclauses.This profile controls when Hibernate may omit functionally dependent columns. Report only behavior guaranteed by the database across the Dialect's supported versions.
- Returns:
- a non-null immutable capability profile
- Since:
- 8.0
- See Also:
-
getObjectNullBindingStrategy
Supply the JDBC strategy for binding an untyped Javanull.- Returns:
- the non-null binding strategy
- Since:
- 8.0
- See Also:
-
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
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
Whether this database supports ANSI
cross joinsyntax.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
-