0% found this document useful (0 votes)
3 views

Dialect (Hibernate Javadocs)

The Dialect class in Hibernate represents a specific SQL dialect for various RDBMS platforms, with subclasses implementing support for individual databases like PostgreSQL and MySQL. It requires subclasses to define column type mappings and register HQL functions, while also being thread-safe and immutable. Since Hibernate 6, versioned dialect classes are deprecated, and a single subclass now represents all releases of a given SQL dialect, with the database version provided at runtime.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Dialect (Hibernate Javadocs)

The Dialect class in Hibernate represents a specific SQL dialect for various RDBMS platforms, with subclasses implementing support for individual databases like PostgreSQL and MySQL. It requires subclasses to define column type mappings and register HQL functions, while also being thread-safe and immutable. Since Hibernate 6, versioned dialect classes are deprecated, and a single subclass now represents all releases of a given SQL dialect, with the database version provided at runtime.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

09/01/2025, 00:19 Dialect (Hibernate Javadocs)

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES SEARCH: Search


SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Package org.hibernate.dialect
Class Dialect

java.lang.Object
org.hibernate.dialect.Dialect

All Implemented Interfaces:


FunctionContributor, TypeContributor, ConversionContext

Direct Known Subclasses:


AbstractHANADialect, AbstractTransactSQLDialect, CockroachDialect, DB2Dialect, DerbyDialect, DialectDelegateWrapper, GenericDialect, H2Dialect,
HSQLDialect, MySQLDialect, OracleDialect, PostgreSQLDialect, SpannerDialect

public abstract class Dialect


extends Object
implements ConversionContext, TypeContributor, FunctionContributor

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

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

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

columnType(int) to define a mapping from SQL type codes to database column types, and
initializeFunctionRegistry(FunctionContributions) to register mappings for standard HQL functions with the SqmFunctionRegistry.

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.

Nested Class Summary

Nested Classes
Modifier and Type Class Description

static interface Dialect.SizeStrategy Pluggable strategy for determining the Size to use for columns of a given SQL type.

class Dialect.SizeStrategyImpl

Field Summary

Fields
Modifier and Type Field Description

static String CLOSED_QUOTE Characters used as closing for quoting SQL identifiers

protected static LobMergeStrategy LEGACY_LOB_MERGE_STRATEGY A LobMergeStrategy representing the legacy behavior of


Hibernate.

protected static double LOG_BASE2OF10

protected static LobMergeStrategy NEW_LOCATOR_LOB_MERGE_STRATEGY A LobMergeStrategy based on creating a new LOB locator.

static String QUOTE Characters used as opening for quoting SQL identifiers

protected STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY
MultiKeyLoadSizingStrategy

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 1/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
protected
OVERVIEW
static LobMergeStrategy STREAM_XFER_LOB_MERGE_STRATEGY
PACKAGE CLASS USE TREE DEPRECATED INDEX HELP A LobMergeStrategy based on transferring contents using
streams.
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Constructor Summary

Constructors
Modifier Constructor Description

protected Dialect() Deprecated.


provide a DatabaseVersion

protected Dialect​(DatabaseVersion version)

protected Dialect​(DialectResolutionInfo info)

Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
Modifier and Type Method Description

String addSqlHintOrComment​(String sql, QueryOptions queryOptions, Modify the SQL, adding hints or comments, if nec
boolean commentsEnabled)

void appendArrayLiteral​(SqlAppender appender, Object[] literal, Append an array literal with the given elements to
JdbcLiteralFormatter<Object> elementFormatter, SqlAppender.
WrapperOptions wrapperOptions)

void appendBinaryLiteral​(SqlAppender appender, byte[] bytes) Append a binary literal to the given SqlAppender.

void appendBooleanValueString​(SqlAppender appender, Append the SQL literal expression representing th


boolean bool) value to the given SqlAppender.

void appendDatetimeFormat​(SqlAppender appender, String format) Translate the given datetime format string from th
language defined by Java's DateTimeFormatter to
language is understood by the native datetime for
for this database (often the to_char() function).

void appendDateTimeLiteral​(SqlAppender appender, Append a datetime literal representing the given


TemporalAccessor temporalAccessor, TemporalType precision, the given SqlAppender.
TimeZone jdbcTimeZone)

void appendDateTimeLiteral​(SqlAppender appender, Append a datetime literal representing the given C


Calendar calendar, TemporalType precision, the given SqlAppender.
TimeZone jdbcTimeZone)

void appendDateTimeLiteral​(SqlAppender appender, Date date, Append a datetime literal representing the given
TemporalType precision, TimeZone jdbcTimeZone) given SqlAppender.

void appendIntervalLiteral​(SqlAppender appender, Append a literal SQL interval representing the g


Duration literal)

void appendLiteral​(SqlAppender appender, String literal) Append a literal string to the given SqlAppender.

String appendLockHint​(LockOptions lockOptions, String tableName) Some dialects support an alternative means to SE
whereby a "lock hint" is appended to the table nam
clause.

void appendUUIDLiteral​(SqlAppender appender, UUID literal) Append a literal SQL uuid representing the given

String applyLocksToSql​(String sql, Modifies the given SQL, applying the appropriate
LockOptions aliasedLockOptions, Map<String,​ specified lock modes and key columns.
String[]> keyColumnNames)

void augmentPhysicalTableTypes​(List<String> tableTypesList)

void augmentRecognizedTableTypes​(List<String> tableTypesList)

IdentifierHelper buildIdentifierHelper​(IdentifierHelperBuilder builder, The IdentifierHelper indicated by this dialect fo


DatabaseMetaData dbMetaData) identifier conversions.

SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() An instance of SQLExceptionConversionDelegate


dialect-specific error or SQLState codes.

boolean canBatchTruncate() Does the truncate table statement accept multi

boolean canCreateCatalog() Does this dialect support creating and dropping c

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 2/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
boolean
OVERVIEW PACKAGE CLASS USE TREE
canCreateSchema
DEPRECATED
()
INDEX HELP Does this dialect support creating and dropping s

boolean
ALL CLASSES canDisableConstraints() Is there some SEARCH:
way to disable foreign key constrain
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD truncating tables? (If there's no way to do it, and if
truncate, we must drop and recreate the constrai

String castPattern​(CastType from, CastType to) Obtain a pattern for the SQL equivalent to a cast

protected String castType​(int sqlTypeCode) The SQL type to use in cast( ... as ... ) expre
casting to the target type represented by the give

protected void checkVersion()

char closeQuote() The character specific to this dialect used to close


identifier.

protected String columnType​(int sqlTypeCode) The database column type name for a given JDBC
in Types or SqlTypes.

void contribute​(TypeContributions typeContributions, Contribute types


ServiceRegistry serviceRegistry)

void contributeFunctions Contribute functions


(FunctionContributions functionContributions)

void contributeTypes​(TypeContributions typeContributions, A callback which allows the Dialect to contribute


ServiceRegistry serviceRegistry)

MutationOperation createOptionalTableUpdateOperation​ Create a MutationOperation for a updating an op


(EntityMutationTarget mutationTarget,
OptionalTableUpdate optionalTableUpdate,
SessionFactoryImplementor factory)

String currentDate() Translation of the HQL/JPQL current_date funct


the Java type Date, and of the HQL local_date fu
to the Java type LocalDate.

String currentLocalTime() Translation of the HQL local_time function, whic


type LocalTime which is a time with no time zone.

String currentLocalTimestamp() Translation of the HQL local_datetime function,


Java type LocalDateTime which is a datetime with

String currentTime() Translation of the HQL/JPQL current_time funct


the Java type Time which is a time with no time zo

String currentTimestamp() Translation of the HQL/JPQL current_timestamp


maps to the Java type Timestamp which is a dateti
zone.

String currentTimestampWithTimeZone() Translation of the HQL offset_datetime function


Java type OffsetDateTime which is a datetime wit

ScrollMode defaultScrollMode() A default ScrollMode to be used by Query.scroll

boolean doesReadCommittedCauseWritersToBlockReaders() For the underlying database, is READ_COMMITTED is


implemented by forcing readers to wait for write
released?

boolean doesRepeatableReadCauseReadersToBlockWriters() For the underlying database, is REPEATABLE_READ i


implemented by forcing writers to wait for read lo

boolean dropConstraints() Do we need to drop constraints before dropping t


dialect?

boolean equivalentTypes​(int typeCode1, int typeCode2) Do the given JDBC type codes, as defined in Types
essentially the same type in this dialect of SQL?

static String escapeComment​(String comment) Perform necessary character escaping on the text

String extractPattern​(TemporalUnit unit) Obtain a pattern for the SQL equivalent to an ext
call.

boolean forceLobAsLastValue() Must LOB values occur last in inserts and updates

String generatedAs​(String generatedAs) The generated as clause, or similar, for generated


declarations in DDL statements.

String getAddColumnString() The subcommand of the alter table command u


column to a table, usually add column or add.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 3/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
StringPACKAGE
OVERVIEW CLASS USE TREE
getAddColumnSuffixString
DEPRECATED INDEX HELP
() The syntax for the suffix used to add a column to a

String
ALL CLASSES getAddForeignKeyConstraintString​(String constraintName, The syntax used to add a foreign key constraint to
SEARCH:
String foreignKeyDefinition) definition of the foreign key as a string.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

String getAddForeignKeyConstraintString​(String constraintName, The syntax used to add a foreign key constraint to
String[] foreignKey, String referencedTable, referenced key columns explicitly specified.
String[] primaryKey, boolean referencesPrimaryKey)

String getAddPrimaryKeyConstraintString​(String constraintName) The syntax used to add a primary key constraint t

AggregateSupport getAggregateSupport() How does this dialect support aggregate types lik

String getAlterColumnTypeString​(String columnName, The fragment of an alter table command which


String columnType, String columnDefinition) type, or null if column types cannot be modified.

String getAlterTableString​(String tableName) The command used to alter a table with the given
alter table tab_name or alter table tab_name

String getArrayTypeName​(String javaElementTypeName, The SQL type name for the array type with eleme
String elementTypeName, Integer maxLength) type name.

Exporter<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectExporter() Get an Exporter for AuxiliaryDatabaseObjects, u


StandardAuxiliaryDatabaseObjectExporter.

MultiKeyLoadSizingStrategy getBatchLoadSizingStrategy() The strategy used to determine the appropriate n


load in a single SQL query with batch-fetch loadin

CallableStatementSupport getCallableStatementSupport() The CallableStatementSupport for this database

String getCascadeConstraintsString() The keyword that specifies that a drop table ope
cascaded to its constraints, typically " cascade" w
space is required, or the empty string if there is no
this dialect.

String getCaseInsensitiveLike() The name of the SQL operator that performs case
comparisons.

String getCheckCondition​(String columnName, long[] values) Deprecated, for removal: This API element is subj
future version.
use getCheckCondition(String, Long[]) instead

String getCheckCondition​(String columnName, long min, long max) Render a SQL check condition for a column that r
enumerated value.

String getCheckCondition​(String columnName, Class<? extends


Enum<?>> enumType)

String getCheckCondition​(String columnName, Long[] values) Render a SQL check condition for a column that r
enumerated value by its ordinal representation or
values.

String getCheckCondition​(String columnName, String[] values) Render a SQL check condition for a column that r
enumerated value by its string representation or
values (with NULL value allowed).

ColumnAliasExtractor getColumnAliasExtractor() A ColumnAliasExtractor, usually just


ResultSetMetaData.getColumnLabel(int).

String getColumnComment​(String comment) Get the comment into a form supported for colum

String[] getCreateCatalogCommand​(String catalogName) Get the SQL command used to create the named c

String[] getCreateEnumTypeCommand​(Class<? extends Enum<?


>> enumType)

String[] getCreateEnumTypeCommand​(String name, String[] values)

String getCreateIndexString​(boolean unique) The command used to create an index, usually cre
create unique index.

String getCreateIndexTail​(boolean unique, List<Column> columns) A string to be appended to the end of the create
usually to specify that null values are to be consid

String getCreateMultisetTableString() Slight variation on getCreateTableString().

String[] getCreateSchemaCommand​(String schemaName) Get the SQL command used to create the named s

String getCreateTableString() The command used to create a table, usually crea

String getCreateTemporaryTableColumnAnnotation​(int sqlTypeCode) Annotation to be appended to the end of each CO


temporary tables.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 4/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
StringPACKAGE
OVERVIEW CLASS USE TREE
getCreateUserDefinedTypeExtensionsString
DEPRECATED INDEX HELP
() An arbitrary extension to append to the end of the
command.
ALL CLASSES SEARCH:
String getCreateUserDefinedTypeKindString() The kind of user-defined type to create, or the em
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
does not need to be specified.

String getCurrentSchemaCommand() Get the SQL command used to retrieve the curren

String getCurrentTimestampSelectString() The command used to retrieve the current timest


database.

int getDefaultDecimalPrecision() This is the default precision for a generated colum


BigInteger or BigDecimal.

int getDefaultIntervalSecondScale() Resolves the default scale for a SqlTypes.INTERVA


code for the given column

long getDefaultLobLength() The default length for a LOB column, if LOB colum
this dialect.

boolean getDefaultNonContextualLobCreation() The default value to use for the configuration pro
"hibernate.jdbc.lob.non_contextual_creation".

Properties getDefaultProperties() Retrieve a set of default Hibernate properties for

int getDefaultStatementBatchSize() The default value to use for the configuration pro
"hibernate.jdbc.batch_size".

int getDefaultTimestampPrecision() This is the default precision for a generated colum


Timestamp or LocalDateTime.

boolean getDefaultUseGetGeneratedKeys() The default value to use for the configuration pro
"hibernate.jdbc.use_get_generated_keys".

String getDisableConstraintsStatement() A SQL statement that temporarily disables foreig


checking for all tables.

String getDisableConstraintStatement​(String tableName, A SQL statement that temporarily disables check


String name) foreign key constraint.

DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport() Get the minimum DmlTargetColumnQualifierSup


this dialect.

int getDoublePrecision() This is the default precision for a generated colum


Java Double or double.

String[] getDropCatalogCommand​(String catalogName) Get the SQL command used to drop the named ca

String[] getDropEnumTypeCommand​(Class<? extends Enum<?>> enumType)

String[] getDropEnumTypeCommand​(String name)

String getDropForeignKeyString() The subcommand of the alter table command u


foreign key constraint, usually drop constraint.

String[] getDropSchemaCommand​(String schemaName) Get the SQL command used to drop the named sc

String getDropTableString​(String tableName) The command used to drop a table with the given
table tab_name.

String getDropUniqueKeyString() The subcommand of the alter table command u


unique key constraint.

String getEnableConstraintsStatement() A SQL statement that re-enables foreign key cons


all tables.

String getEnableConstraintStatement​(String tableName, A SQL statement that re-enables checking of the g


String name) constraint.

String getEnumTypeDeclaration​(Class<? extends Enum<?>> enumType)

String getEnumTypeDeclaration​(String name, String[] values) If this database has a special MySQL-style enum co
the type declaration for the given enumeration of

SchemaManagementTool getFallbackSchemaManagementTool​(Map<String,​ The SchemaManagementTool to use if none is explic


Object> configurationValues,
ServiceRegistryImplementor registry)

SqmMultiTableInsertStrategy getFallbackSqmInsertStrategy​ The SqmMultiTableInsertStrategy to use when n


(EntityMappingType entityDescriptor, QueryEngineOptions.getCustomSqmMultiTableIn
RuntimeModelCreationContext runtimeModelCreationContext)

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 5/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
SqmMultiTableMutationStrategy
OVERVIEW PACKAGE CLASS USE TREE
getFallbackSqmMutationStrategy
DEPRECATED INDEX HELP
​ The SqmMultiTableMutationStrategy to use whe
(EntityMappingType entityDescriptor, QueryEngineOptions.getCustomSqmMultiTableMu
ALL CLASSES RuntimeModelCreationContext runtimeModelCreationContext) SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
int getFloatPrecision() This is the default precision for a generated colum
Java Float or float.

Exporter<ForeignKey> getForeignKeyExporter() Get an Exporter for ForeignKeys, usually


StandardForeignKeyExporter.

String getForUpdateNowaitString() Retrieves the FOR UPDATE NOWAIT syntax specific

String getForUpdateNowaitString​(String aliases) Get the FOR UPDATE OF column_list NOWAIT frag
for this dialect, given the aliases of the columns to

String getForUpdateSkipLockedString() Retrieves the FOR UPDATE SKIP LOCKED syntax sp


dialect.

String getForUpdateSkipLockedString​(String aliases) Get the FOR UPDATE OF column_list SKIP LOCKE
appropriate for this dialect, given the aliases of th
write locked.

String getForUpdateString() Get the string to append to SELECT statements to


UPGRADE locks for this dialect.

String getForUpdateString​(String aliases) Get the FOR UPDATE OF column_list fragment ap


dialect, given the aliases of the columns to be writ

String getForUpdateString​(String aliases, Get the FOR UPDATE OF or FOR SHARE OF fragment
LockOptions lockOptions) this dialect, given the aliases of the columns to be

String getForUpdateString​(LockMode lockMode) Given a LockMode, determine the appropriate for


to use to obtain the lock.

String getForUpdateString​(LockOptions lockOptions) Given a set of LockOptions (lock level, timeout), d


appropriate for update fragment to use to obtain

long getFractionalSecondPrecisionInNanos() The "native" precision for arithmetic with datetim


second durations.

FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport() Get this dialect's level of support for primary key
dependency analysis within GROUP BY and ORDER B

SelectItemReferenceStrategy getGroupBySelectItemReferenceStrategy() Determine how selected items are referenced in t


clause.

HqlTranslator getHqlTranslator() Return an HqlTranslator specific to this dialect, o


standard translator.

IdentityColumnSupport getIdentityColumnSupport() Get the appropriate IdentityColumnSupport for t

Exporter<Index> getIndexExporter() Get an Exporter for Indexes, usually StandardInd

int getInExpressionCountLimit() Return the limit that the underlying database plac
of elements in an IN predicate.

Set<String> getKeywords() The keywords of this SQL dialect.

LimitHandler getLimitHandler() Obtain a LimitHandler that implements paginatio


Query.setMaxResults(int) and Query.setFirstR

LobMergeStrategy getLobMergeStrategy() Get the LobMergeStrategy to use, NEW_LOCATOR_LO


by default.

LockingStrategy getLockingStrategy​(Lockable lockable, LockMode lockMode) A LockingStrategy which is able to acquire a data
with the specified level.

RowLockStrategy getLockRowIdentifier​(LockMode lockMode) Obtain a RowLockStrategy for the given LockMode

String getLowercaseFunction() The name of the SQL function that transforms a s


almost always lower.

int getMaxAliasLength() What is the maximum length Hibernate can use fo


aliases?

int getMaxIdentifierLength() What is the maximum identifier length supported

int getMaxNVarcharCapacity() The longest possible length of a Types.NVARCHAR-l

int getMaxNVarcharLength() The biggest size value that can be supplied as argu
Types.NVARCHAR-like type.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 6/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
int
OVERVIEW PACKAGE CLASS USE TREE
getMaxVarbinaryCapacity
DEPRECATED INDEX HELP
() The longest possible length of a Types.VARBINARY

int
ALL CLASSES getMaxVarbinaryLength() The biggest size value that can be supplied as argu
SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD Types.VARBINARY-like type.

int getMaxVarcharCapacity() The longest possible length of a Types.VARCHAR-lik

int getMaxVarcharLength() The biggest size value that can be supplied as argu
Types.VARCHAR-like type.

protected DatabaseVersion getMinimumSupportedVersion() Get the version of the SQL dialect that is the mini
this implementation.

MultiKeyLoadSizingStrategy getMultiKeyLoadSizingStrategy() The strategy used to determine the appropriate n


load in a single SQL query with multi-key loading.

NameQualifierSupport getNameQualifierSupport() The support for qualified identifiers.

NationalizationSupport getNationalizationSupport() Determines whether this database requires the u


nationalized character (Unicode) data types.

String getNativeIdentifierGeneratorStrategy() The name identifying the "native" id generation st


dialect.

ParameterMarkerStrategy getNativeParameterMarkerStrategy() Support for native parameter markers.

String getNoColumnsInsertString() Deprecated.


Override the method renderInsertIntoNoColumn
translator returned by this dialect.

String getNullColumnString() The keyword used to specify a nullable column, us


sometimes " null".

String getNullColumnString​(String columnType) The keyword used to specify a nullable column of


type.

NullOrdering getNullOrdering() Returns the default ordering of null.

int getParameterCountLimit() Return the limit that the underlying database plac
of parameters that can be defined for a PreparedS

int getPreferredSqlTypeCodeForArray() The JDBC type code to use for mapping propertie
array or Collection types.

int getPreferredSqlTypeCodeForBoolean() The JDBC type code to use for mapping propertie
boolean.

String getQueryHintString​(String query, String hints) Apply a hint to the given SQL query.

String getQueryHintString​(String query, List<String> hintList) Apply a hint to the given SQL query.

String getQuerySequencesString() Get the select command used retrieve the names

String getReadLockString​(int timeout) Get the string to append to SELECT statements to


locks for this dialect.

String getReadLockString​(String aliases, int timeout) Get the string to append to SELECT statements to
locks for this dialect, given the aliases of the colum
locked.

RowLockStrategy getReadRowLockStrategy() The row lock strategy to use for read locks.

ResultSet getResultSet​(CallableStatement statement) Given a callable statement previously processed b


registerResultSetOutParameter(java.sql.Call
int), extract the ResultSet from the OUT paramet

ResultSet getResultSet​(CallableStatement statement, int position) Given a callable statement previously processed b
registerResultSetOutParameter(java.sql.Call
int), extract the ResultSet from the positional OU

ResultSet getResultSet​(CallableStatement statement, String name) Given a callable statement previously processed b
registerResultSetOutParameter(java.sql.Call
int), extract the ResultSet from the named OUT p

String getRowIdColumnString​(String rowId) If this dialect requires that the rowid column be d
return the DDL column definition.

SchemaNameResolver getSchemaNameResolver() Get the strategy for determining the schema nam
Connection, usually DefaultSchemaNameResolver.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 7/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
StringPACKAGE
OVERVIEW CLASS USE TREE
getSelectClauseNullString
DEPRECATED INDEX HELP
(int sqlType,
​ Given a JDBC type code, return the expression fo
TypeConfiguration typeConfiguration) of that type, to use in a select clause.
ALL CLASSES SEARCH:
String getSelectGUIDString() Get the command used to select a GUID from the
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Exporter<Sequence> getSequenceExporter() Get an Exporter for Sequences, usually StandardS

SequenceInformationExtractor getSequenceInformationExtractor() A SequenceInformationExtractor which is able to


SequenceInformation from the JDBC result set re
getQuerySequencesString() is executed.

SequenceSupport getSequenceSupport() Get the appropriate SequenceSupport for this dia

Dialect.SizeStrategy getSizeStrategy() A custom Dialect.SizeStrategy for column type

SqlAstTranslatorFactory getSqlAstTranslatorFactory() Return a SqlAstTranslatorFactory specific to thi


use the standard translator.

SqmTranslatorFactory getSqmTranslatorFactory() Return a SqmTranslatorFactory specific to this di


use the standard translator.

TemporaryTableKind getSupportedTemporaryTableKind() The kind of temporary tables that are supported o

Cleaner getTableCleaner() Get a schema Cleaner, usually StandardTableCle

String getTableComment​(String comment) Get the comment into a form supported for table

Exporter<Table> getTableExporter() Get an Exporter for Tables, usually StandardTabl

TableMigrator getTableMigrator() Get a TableMigrator, usually StandardTableMigr

String getTableTypeString() An arbitrary fragment appended to the end of the


statement.

AfterUseAction getTemporaryTableAfterUseAction() The action to take after finishing use of a tempora

BeforeUseAction getTemporaryTableBeforeUseAction() The action to take before beginning use of a temp

String getTemporaryTableCreateCommand() The command to create a temporary table.

String getTemporaryTableCreateOptions() An arbitrary SQL fragment appended to the end o


create a temporary table, specifying dialect-speci
if there are no options to specify.

TempTableDdlTransactionHandling getTemporaryTableDdlTransactionHandling() The sort of transaction handling to use when crea


temporary tables.

String getTemporaryTableDropCommand() The command to drop a temporary table.

TemporaryTableExporter getTemporaryTableExporter() Get a TemporaryTableExporter, usually


StandardTemporaryTableExporter.

String getTemporaryTableTruncateCommand() The command to truncate a temporary table.

protected int getTimeoutInSeconds​(int millis)

TimeZoneSupport getTimeZoneSupport() How the dialect supports time zone types like
Types.TIMESTAMP_WITH_TIMEZONE.

String getTruncateTableStatement​(String tableName) A SQL statement that truncates the given table.

String[] getTruncateTableStatements​(String[] tableNames) A SQL statement or statements that truncate the

UniqueDelegate getUniqueDelegate() Get the UniqueDelegate supported by this dialect

Exporter<Constraint> getUniqueKeyExporter() Get an Exporter for unique key Constraints, usua


StandardUniqueKeyExporter.

String getUserDefinedTypeComment​(String comment) Get the comment into a form supported for UDT d

Exporter<UserDefinedType> getUserDefinedTypeExporter() Get an Exporter for UserDefinedTypes, usually


StandardUserDefinedTypeExporter.

DatabaseVersion getVersion() Get the version of the SQL dialect that is the targe

ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor() A ViolatedConstraintNameExtractor for extracti


violated constraint from a SQLException.

String getWriteLockString​(int timeout) Get the string to append to SELECT statements to


WRITE locks for this dialect.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 8/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
StringPACKAGE
OVERVIEW CLASS USE TREE
getWriteLockString
DEPRECATED INDEX HELP
​(String aliases, int timeout) Get the string to append to SELECT statements to
locks for this dialect, given the aliases of the colum
ALL CLASSES SEARCH:
locked.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
RowLockStrategy getWriteRowLockStrategy() The row lock strategy to use for write locks.

boolean hasAlterTable() Does this dialect support the ALTER TABLE syntax

boolean hasDataTypeBeforeGeneratedAs() Is an explicit column type required for generated

boolean hasSelfReferentialForeignKeyBug() Does the database/driver have bug in deleting row


other rows being deleted in the same query?

protected void initDefaultProperties() Set appropriate default values for configuration p

void initializeFunctionRegistry​ Initialize the given registry with any dialect-specifi


(FunctionContributions functionContributions)

String inlineLiteral​(String literal) Deprecated, for removal: This API element is subj
future version.
This is no longer called

boolean isAnsiNullOn() Deprecated.


This is only called from SybaseASESqlAstTranslat
need to be declared here.

boolean isCurrentTimestampSelectStringCallable() Is the command returned by getCurrentTimestam


treated as callable?

boolean isEmptyStringTreatedAsNull() Return whether the dialect considers an empty st


null.

boolean isJdbcLogWarningsEnabledByDefault() Is JDBC statement warning logging enabled by de

protected boolean isLob​(int sqlTypeCode)

boolean isLockTimeoutParameterized() Deprecated, for removal: This API element is subj


future version.
This is never called, and since at least Hibernate 5
false in every dialect.

char openQuote() The character specific to this dialect used to begin


identifier.

int ordinal() Determines order in which the contributions will


ordinal first).

protected String prependComment​(String sql, String comment) Prepend a comment to the given SQL fragment.

boolean qualifyIndexName() Do we need to qualify index names with the schem

String quote​(String name) Apply dialect-specific quoting if the given name is


backticks.

String quoteCollation​(String collation) Quote the given collation name if necessary.

protected void registerColumnTypes​(TypeContributions typeContributions, Register ANSI-standard column types using the le
ServiceRegistry serviceRegistry) by getMaxVarcharLength(), getMaxNVarcharLengt
getMaxVarbinaryLength().

protected void registerDefaultKeywords() Register the reserved words of ANSI-standard SQ

protected void registerKeyword​(String word) Register a keyword.

protected void registerKeywords​(DialectResolutionInfo info) Register the reserved words reported by the JDB
keywords.

int registerResultSetOutParameter​(CallableStatement statement, Registers a parameter capable of returning a Resu


int position) either an OUT parameter, or a REF_CURSOR paramet
Java 8.

int registerResultSetOutParameter​(CallableStatement statement, Registers a parameter capable of returning a Resu


String name) either an OUT parameter, or a REF_CURSOR paramet
Java 8.

boolean requiresCastForConcatenatingNonStrings() Does this dialect/database require casting of non-


in the concat() function?

boolean requiresFloatCastingOfIntegerDivision() Does this dialect require that integer divisions be


calls to tell the db parser the expected type.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 9/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
boolean
OVERVIEW PACKAGE CLASS USE TREE
requiresParensForTupleCounts
DEPRECATED INDEX HELP
() If supportsTupleCounts() is true, does this dialec
to be delimited with parentheses?
ALL CLASSES SEARCH:
boolean requiresParensForTupleDistinctCounts() If supportsTupleDistinctCounts() is true, does t
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
the tuple to be delimited with parentheses?

protected Integer resolveSqlTypeCode​(String typeName, String baseTypeName, Resolves the SqlTypes type code for the given col
TypeConfiguration typeConfiguration) reported by the database and the base type name

protected Integer resolveSqlTypeCode​(String columnTypeName, Resolves the SqlTypes type code for the given col
TypeConfiguration typeConfiguration) reported by the database, or null if it can't be res

JdbcType resolveSqlTypeDescriptor​(String columnTypeName, Assigns an appropriate JdbcType to a column of a


int jdbcTypeCode, int precision, int scale, based on the column type name, JDBC type code,
JdbcTypeRegistry jdbcTypeRegistry) scale.

int resolveSqlTypeLength​(String columnTypeName, Determine the length/precision of a column based


int jdbcTypeCode, int precision, int scale, the JDBC ResultSetMetaData.
int displaySize)

String rowId​(String rowId) The name of a rowid-like pseudo-column which ac


performance row locator, or null if this dialect has
column.

int rowIdSqlType() The JDBC type code of the rowid-like pseudo-colu


high-performance row locator.

boolean supportsAlterColumnType() Does this dialect support modifying the type of an

Boolean supportsBatchUpdates() Whether this Dialect supports batch updates.

boolean supportsBindAsCallableArgument() Does this dialect support using a JDBC bind param
argument to a function or procedure call?

boolean supportsBitType() Does this dialect have a true SQL BIT type with ju
and 1) or, even better, a proper SQL BOOLEAN type,
get mapped to a numeric type with more than two

boolean supportsCascadeDelete() Does this dialect support on delete actions in for


definitions?

boolean supportsCaseInsensitiveLike() Does this dialect support case-insensitive LIKE co

boolean supportsCircularCascadeDeleteConstraints() Does this dialect support definition of cascade de


which can cause circular chains?

boolean supportsColumnCheck() Does this dialect support column-level check cons

boolean supportsCommentOn() Does this dialect support commenting on tables a

boolean supportsCurrentTimestampSelection() Does this dialect support some way to retrieve th


timestamp value from the database?

boolean supportsDistinctFromPredicate() Does this dialect support some kind of distinct

boolean supportsExistsInSelect() Does the dialect support an exists statement in th

boolean supportsExpectedLobUsagePattern() "Expected" LOB usage pattern is such that I can p


via prepared statement with a parameter binding
without crazy casting to JDBC driver implementa
classes.

boolean supportsFetchClause​(FetchClauseType type) Does this dialect support the given FETCH clause ty

boolean supportsFractionalTimestampArithmetic() Whether the database supports adding a fraction


timestamp, for example timestamp + 0.5 second

boolean supportsIfExistsAfterAlterTable() For an alter table, can the phrase if exists be

boolean supportsIfExistsAfterConstraintName() For dropping a constraint with an alter table, ca


exists be applied after the constraint name?

boolean supportsIfExistsAfterTableName() For dropping a table, can the phrase if exists be


table name?

boolean supportsIfExistsAfterTypeName() For dropping a type, can the phrase if exists be


type name?

boolean supportsIfExistsBeforeConstraintName() For dropping a constraint with an alter table sta


phrase if exists be applied before the constrain

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 10/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
boolean
OVERVIEW PACKAGE CLASS USE TREE
supportsIfExistsBeforeTableName
DEPRECATED INDEX HELP
() For dropping a table, can the phrase if exists be
table name?
ALL CLASSES SEARCH:
boolean supportsIfExistsBeforeTypeName() For dropping a type, can the phrase if exists be
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
type name?

boolean supportsInsertReturning() Does this dialect fully support returning arbitrary


values after execution of an insert statement, us
syntax?

boolean supportsInsertReturningGeneratedKeys() Does this dialect fully support returning arbitrary


values after execution of an insert statement, us
method Connection.prepareStatement(String,

boolean supportsIsTrue() Does this dialect support the is true and is fal

boolean supportsJdbcConnectionLobCreation Check whether the JDBC Connection supports cr


(DatabaseMetaData databaseMetaData) Connection.createBlob(), Connection.createNC
Connection.createClob().

boolean supportsLateral() Does this dialect support the SQL lateral keywo
alternative?

boolean supportsLobValueChangePropagation() Does the dialect support propagating changes to


the database? Talking about mutating the interna
locator, as opposed to supplying a new locator ins

boolean supportsLockTimeouts() Does this dialect support specifying timeouts whe

boolean supportsMaterializedLobAccess() Check whether the JDBC driver allows setting LO


PreparedStatement.setBytes(int, byte[]),
PreparedStatement.setNString(int, String), o
PreparedStatement.setString(int, String) AP

boolean supportsNamedParameters​(DatabaseMetaData databaseMetaData) Override DatabaseMetaData.supportsNamedParam

boolean supportsNoColumnsInsert() Is the INSERT statement is allowed to contain no c

boolean supportsNonQueryWithCTE() Does this dialect support insert, update, and delet
Common Table Expressions (CTEs)?

boolean supportsNoWait() Does this dialect support NO_WAIT timeout.

boolean supportsNullPrecedence() Does this dialect support nulls first and nulls

boolean supportsOffsetInSubquery() Does this dialect support offset in subqueries?

boolean supportsOrderByInSubquery() Does this dialect support the order by clause in s

boolean supportsOrdinalSelectItemReference() Does this dialect support references to result var


items) by column positions (1-origin) as defined by

boolean supportsOuterJoinForUpdate() Does this dialect support FOR UPDATE in conjuncti


joined rows?

boolean supportsParametersInInsertSelect() Deprecated, for removal: This API element is subj


future version.
This seems to be supported on all platforms, and w
except in test suite

boolean supportsPartitionBy() Does is dialect support partition by?

protected boolean supportsPredicateAsExpression() Whether a predicate like a > 0 can appear in an e


for example, in a select list item.

boolean supportsRecursiveCTE() Does this dialect/database support recursive CTE

Boolean supportsRefCursors() Whether this Dialect supports the JDBC Types.R

boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() Does this dialect support asking the result set its
information on forward-only cursors?

boolean supportsSkipLocked() Does this dialect support SKIP_LOCKED timeout.

boolean supportsStandardArrays() Does this database have native support for ANSI S
arrays which are expressed in terms of the elemen
integer array.

boolean supportsStandardCurrentTimestampFunction() Does this dialect have an ANSI SQL current_time

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 11/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
boolean
OVERVIEW PACKAGE CLASS USE TREE
supportsSubqueryInSelect
DEPRECATED INDEX HELP
() Does this dialect support subqueries in the selec

boolean
ALL CLASSES supportsSubqueryOnMutatingTable() Does this dialect support referencing the table be
SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD subquery? The "table being mutated" is the table
update or delete query.

boolean supportsSubselectAsInPredicateLHS() Is a subselect supported as the left-hand side (LHS


predicates?

boolean supportsTableCheck() Does this dialect support table-level check constr

boolean supportsTemporalLiteralOffset() Does this dialect supports timezone offsets in tem

boolean supportsTemporaryTablePrimaryKey() Does this database support primary keys for temp

boolean supportsTemporaryTables() Does this database have some sort of support for

boolean supportsTruncateWithCast() Does this dialect support truncation of values to a


via a cast?

boolean supportsTupleCounts() Does this dialect support count(a,b)?

boolean supportsTupleDistinctCounts() Does this dialect support count(distinct a,b)?

boolean supportsUnboundedLobLocatorMaterialization() Is it supported to materialize a LOB locator outsid


in which it was created?

boolean supportsUnionAll() Does this dialect support UNION ALL?

boolean supportsUnionInSubquery() Does this dialect support UNION in a subquery.

boolean supportsValuesList() Does this dialect support values lists of form VALU
(3)?

boolean supportsValuesListForInsert() Does this dialect support values lists of form VALU
in insert statements?

boolean supportsWait() Does this dialect support WAIT timeout.

boolean supportsWindowFunctions() Does this dialect support window functions like ro


(..)?

String timestampaddPattern​(TemporalUnit unit, Obtain a pattern for the SQL equivalent to a time
TemporalType temporalType, IntervalType intervalType) function call.

String timestampdiffPattern​(TemporalUnit unit, Obtain a pattern for the SQL equivalent to a time
TemporalType fromTemporalType, function call.
TemporalType toTemporalType)

String toBooleanValueString​(boolean bool) The SQL literal expression representing the given

String toQuotedIdentifier​(String name) Apply dialect-specific quoting.

String toString()

String transformSelectString​(String select) Meant as a means for end users to affect the selec
sent to the database and perhaps manipulate them

String translateDurationField​(TemporalUnit unit) Return the name used to identify the given unit of
argument to #timestampadd() or #timestampdiff
dialect's equivalent functions.

String translateExtractField​(TemporalUnit unit) Return the name used to identify the given field a
the extract() function, or of this dialect's equiva

String trimPattern​(TrimSpec specification, boolean isWhitespace) Obtain a pattern for the SQL equivalent to a trim

String trimPattern​(TrimSpec specification, char character) Deprecated, for removal: This API element is subj
future version.
Use trimPattern(TrimSpec, boolean) instead.

boolean useArrayForMultiValuedParameters() Does this database prefer to use array types for m
parameters.

boolean useFollowOnLocking​(String sql, QueryOptions queryOptions) Some dialects have trouble applying pessimistic lo
upon what other query options are specified (pag

boolean useInputStreamToInsertBlob() Should LOBs (both BLOB and CLOB) be bound us


operations, that is, using PreparedStatement.set
java.io.InputStream, int)).

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 12/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
boolean
OVERVIEW PACKAGE CLASS USE TREE
useMaterializedLobWhenCapacityExceeded
DEPRECATED INDEX HELP
() Whether to switch: from VARCHAR-like types to
SqlTypes.MATERIALIZED_CLOB types when the req
ALL CLASSES SEARCH:
type exceeds the getMaxVarcharCapacity(), from
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD types to SqlTypes.MATERIALIZED_NCLOB types wh
size for a type exceeds the getMaxNVarcharCapaci
VARBINARY-like types to SqlTypes.MATERIALIZED_
the requested size for a type exceeds the
getMaxVarbinaryCapacity().

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

QUOTE

public static final String QUOTE

Characters used as opening for quoting SQL identifiers

See Also:
Constant Field Values

CLOSED_QUOTE

public static final String CLOSED_QUOTE

Characters used as closing for quoting SQL identifiers

See Also:
Constant Field Values

LOG_BASE2OF10

protected static final double LOG_BASE2OF10

LEGACY_LOB_MERGE_STRATEGY

protected static final LobMergeStrategy LEGACY_LOB_MERGE_STRATEGY

A LobMergeStrategy representing the legacy behavior of Hibernate. LOBs are not processed by merge.

STREAM_XFER_LOB_MERGE_STRATEGY

protected static final LobMergeStrategy STREAM_XFER_LOB_MERGE_STRATEGY

A LobMergeStrategy based on transferring contents using streams.

NEW_LOCATOR_LOB_MERGE_STRATEGY

protected static final LobMergeStrategy NEW_LOCATOR_LOB_MERGE_STRATEGY

A LobMergeStrategy based on creating a new LOB locator.

STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 13/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
protected final MultiKeyLoadSizingStrategy STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES SEARCH:


SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Constructor Detail

Dialect

@Deprecated(since="6.0")
protected Dialect()

Deprecated.
provide a DatabaseVersion

Dialect

protected Dialect​(DatabaseVersion version)

Dialect

protected Dialect​(DialectResolutionInfo info)

Method Detail

checkVersion

protected void checkVersion()

initDefaultProperties

protected void initDefaultProperties()

Set appropriate default values for configuration properties.

This default implementation sets "hibernate.jdbc.batch_size", "hibernate.jdbc.lob.non_contextual_creation", and


"hibernate.jdbc.use_get_generated_keys" to defaults determined by calling getDefaultStatementBatchSize(),
getDefaultNonContextualLobCreation(), and getDefaultUseGetGeneratedKeys().

An implementation may set additional configuration properties, but this is discouraged.

registerColumnTypes

protected void registerColumnTypes​(TypeContributions typeContributions, ServiceRegistry serviceRegistry)

Register ANSI-standard column types using the length limits defined by getMaxVarcharLength(), getMaxNVarcharLength(), and
getMaxVarbinaryLength().

This method is always called when a Dialect is instantiated.

isLob

protected boolean isLob​(int sqlTypeCode)

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 14/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

columnType
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
protected String columnType​(int sqlTypeCode) SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
The database column type name for a given JDBC type code defined in Types or SqlTypes. This default implementation returns the ANSI-standard type
name.

This method may be overridden by concrete Dialects as an alternative to registerColumnTypes(TypeContributions, ServiceRegistry) for simple
registrations.

Note that:

1. Implementations of this method are expected to define a sensible mapping forTypes.NCLOB Types.NCHAR, and Types.NVARCHAR. On some database,
these types are simply remapped to CLOB, CHAR, and VARCHAR.
2. Mappings for Types.TIMESTAMP and Types.TIMESTAMP_WITH_TIMEZONE should support explicit specification of precision if possible.
3. As specified by DdlTypeRegistry.getDescriptor(int), this method never receives Types.LONGVARCHAR, Types.LONGNVARCHAR, nor
Types.LONGVARBINARY, which are considered synonyms for their non-LONG counterparts.
4. On the other hand, the types SqlTypes.LONG32VARCHAR, SqlTypes.LONG32NVARCHAR, and SqlTypes.LONG32VARBINARY are not synonyms, and
implementations of this method must define sensible mappings, for example to database-native TEXT or CLOB types.

Parameters:
sqlTypeCode - a SQL type code

Returns:
a column type name, with $l, $p, $s placeholders for length, precision, scale

See Also:
SqlTypes

castType

protected String castType​(int sqlTypeCode)

The SQL type to use in cast( ... as ... ) expressions when casting to the target type represented by the given JDBC type code.

Parameters:
sqlTypeCode - The JDBC type code representing the target type

Returns:
The SQL type to use in cast()

registerDefaultKeywords

protected void registerDefaultKeywords()

Register the reserved words of ANSI-standard SQL as keywords.

See Also:
AnsiSqlKeywords

registerKeywords

protected void registerKeywords​(DialectResolutionInfo info)

Register the reserved words reported by the JDBC driver as keywords.

See Also:
DatabaseMetaData.getSQLKeywords()

getVersion

public DatabaseVersion getVersion()

Get the version of the SQL dialect that is the target of this instance.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 15/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

getMinimumSupportedVersion
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
protected DatabaseVersion getMinimumSupportedVersion() SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Get the version of the SQL dialect that is the minimum supported by this implementation.

resolveSqlTypeCode

protected Integer resolveSqlTypeCode​(String columnTypeName, TypeConfiguration typeConfiguration)

Resolves the SqlTypes type code for the given column type name as reported by the database, or null if it can't be resolved.

resolveSqlTypeCode

protected Integer resolveSqlTypeCode​(String typeName, String baseTypeName, TypeConfiguration typeConfiguration)

Resolves the SqlTypes type code for the given column type name as reported by the database and the base type name (i.e. without precision, length and
scale), or null if it can't be resolved.

resolveSqlTypeDescriptor

public JdbcType resolveSqlTypeDescriptor​(String columnTypeName, int jdbcTypeCode, int precision, int scale,
JdbcTypeRegistry jdbcTypeRegistry)

Assigns an appropriate JdbcType to a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.

Parameters:
columnTypeName - the column type name

jdbcTypeCode - the type code

precision - the precision or 0

scale - the scale or 0

Returns:
an appropriate instance of JdbcType

resolveSqlTypeLength

public int resolveSqlTypeLength​(String columnTypeName, int jdbcTypeCode, int precision, int scale, int displaySize)

Determine the length/precision of a column based on information in the JDBC ResultSetMetaData. Note that what JDBC reports as a "precision" might
actually be the column length.

Parameters:
columnTypeName - the name of the column type

jdbcTypeCode - the JDBC type code of the column type

precision - the (numeric) precision or (character) length of the column

scale - the scale of a numeric column

displaySize - the display size of the column

Returns:
the precision or length of the column

getEnumTypeDeclaration

public String getEnumTypeDeclaration​(String name, String[] values)

If this database has a special MySQL-style enum column type, return the type declaration for the given enumeration of values.

If the database has no such type, return null.

Parameters:
values - the enumerated values of the type

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 16/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Returns:
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
the DDL column type declaration
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

getEnumTypeDeclaration

public String getEnumTypeDeclaration​(Class<? extends Enum<?>> enumType)

getCreateEnumTypeCommand

public String[] getCreateEnumTypeCommand​(String name, String[] values)

getCreateEnumTypeCommand

public String[] getCreateEnumTypeCommand​(Class<? extends Enum<?>> enumType)

getDropEnumTypeCommand

public String[] getDropEnumTypeCommand​(String name)

getDropEnumTypeCommand

public String[] getDropEnumTypeCommand​(Class<? extends Enum<?>> enumType)

getCheckCondition

public String getCheckCondition​(String columnName, String[] values)

Render a SQL check condition for a column that represents an enumerated value by its string representation or a given list of values (with NULL value
allowed).

Returns:
a SQL expression that will occur in a check constraint

getCheckCondition

public String getCheckCondition​(String columnName, Class<? extends Enum<?>> enumType)

getCheckCondition

public String getCheckCondition​(String columnName, long min, long max)

Render a SQL check condition for a column that represents an enumerated value. by its ordinal representation.

Returns:
a SQL expression that will occur in a check constraint

getCheckCondition

@Deprecated(forRemoval=true) public String getCheckCondition​


(String columnName, long[] values)

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 17/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

Deprecated,
OVERVIEW PACKAGEforCLASS
removal:
USEThisTREE
API element is subject
DEPRECATED INDEXto removal
HELP in a future version.
use getCheckCondition(String, Long[]) instead
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Render a SQL check condition for a column that represents an enumerated value by its ordinal representation.

Returns:
a SQL expression that will occur in a check constraint

getCheckCondition

public String getCheckCondition​(String columnName, Long[] values)

Render a SQL check condition for a column that represents an enumerated value by its ordinal representation or a given list of values.

Returns:
a SQL expression that will occur in a check constraint

contributeFunctions

public void contributeFunctions​(FunctionContributions functionContributions)

Description copied from interface: FunctionContributor


Contribute functions

Specified by:
contributeFunctions in interface FunctionContributor

Parameters:
functionContributions - The target for the contributions

ordinal

public int ordinal()

Description copied from interface: FunctionContributor


Determines order in which the contributions will be applied (lowest ordinal first).

The range 0-500 is reserved for Hibernate, range 500-1000 for libraries and 1000-Integer.MAX_VALUE for user-defined FunctionContributors.

Contributions from higher precedence contributors (higher numbers) effectively override contributions from lower precedence. E.g. if a contributor
with precedence 1000 contributes a function named "max", that will override Hibernate's standard function of that name.

Specified by:
ordinal in interface FunctionContributor

Returns:
the ordinal for this FunctionContributor

initializeFunctionRegistry

public void initializeFunctionRegistry​(FunctionContributions functionContributions)

Initialize the given registry with any dialect-specific functions.

Support for certain SQL functions is required, and if the database does not support a required function, then the dialect must define a way to emulate it.

These required functions include the functions defined by the JPA query language specification:

avg(arg) - aggregate function


count([distinct ]arg) - aggregate function
max(arg) - aggregate function
min(arg) - aggregate function
sum(arg) - aggregate function
coalesce(arg0, arg1, ...)
nullif(arg0, arg1)
lower(arg)
upper(arg)

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 18/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
length(arg)
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
concat(arg0, arg1, ...)
ALL CLASSES locate(pattern, string[, start]) SEARCH:
substring(string,
SUMMARY: NESTED | FIELD | CONSTRstart[,
| METHODlength])
DETAIL: FIELD | CONSTR | METHOD
trim([[spec ][character ]from] string)
abs(arg)
mod(arg0, arg1)
sqrt(arg)
current date
current time
current timestamp
Along with an additional set of functions defined by ANSI SQL:
any(arg) - aggregate function
every(arg) - aggregate function
var_samp(arg) - aggregate function
var_pop(arg) - aggregate function
stddev_samp(arg) - aggregate function
stddev_pop(arg) - aggregate function
cast(arg as Type)
extract(field from arg)
ln(arg)
exp(arg)
power(arg0, arg1)
floor(arg)
ceiling(arg)
position(pattern in string)
substring(string from start[ for length])
overlay(string placing replacement from start[ for length])
And the following functions for working with java.time types:
local date
local time
local datetime
offset datetime
instant
And a number of additional "standard" functions:
left(string, length)
right(string, length)
replace(string, pattern, replacement)
pad(string with length spec[ character])
repeat(string, times)
pi
log10(arg)
log(base, arg)
sign(arg)
sin(arg)
cos(arg)
tan(arg)
asin(arg)
acos(arg)
atan(arg)
atan2(arg0, arg1)
round(arg0[, arg1])
truncate(arg0[, arg1])
sinh(arg)
tanh(arg)
cosh(arg)
least(arg0, arg1, ...)
greatest(arg0, arg1, ...)
degrees(arg)
radians(arg)
format(datetime as pattern)
collate(string as collation)
str(arg) - synonym of cast(a as String)
ifnull(arg0, arg1) - synonym of coalesce(a, b)
Finally, the following functions are defined as abbreviations for extract(), and desugared by the parser:
second(arg) - synonym of extract(second from a)
minute(arg) - synonym of extract(minute from a)
hour(arg) - synonym of extract(hour from a)
day(arg) - synonym of extract(day from a)
month(arg) - synonym of extract(month from a)
year(arg) - synonym of extract(year from a)

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 19/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Note that according to this definition, the second() function returns a floating point value, contrary to the integer type returned by the native function
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
with this name on many databases. Thus, we don't just naively map these HQL functions to the native SQL functions with the same names.
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

currentDate

public String currentDate()

Translation of the HQL/JPQL current_date function, which maps to the Java type Date, and of the HQL local_date function which maps to the Java type
LocalDate.

currentTime

public String currentTime()

Translation of the HQL/JPQL current_time function, which maps to the Java type Time which is a time with no time zone. This contradicts ANSI SQL
where current_time has the type TIME WITH TIME ZONE.

It is recommended to override this in dialects for databases which support localtime or time at local.

currentTimestamp

public String currentTimestamp()

Translation of the HQL/JPQL current_timestamp function, which maps to the Java type Timestamp which is a datetime with no time zone. This
contradicts ANSI SQL where current_timestamp has the type TIMESTAMP WITH TIME ZONE.

It is recommended to override this in dialects for databases which support localtimestamp or timestamp at local.

currentLocalTime

public String currentLocalTime()

Translation of the HQL local_time function, which maps to the Java type LocalTime which is a time with no time zone. It should usually be the same SQL
function as for currentTime().

It is recommended to override this in dialects for databases which support localtime or current_time at local.

currentLocalTimestamp

public String currentLocalTimestamp()

Translation of the HQL local_datetime function, which maps to the Java type LocalDateTime which is a datetime with no time zone. It should usually be
the same SQL function as for currentTimestamp().

It is recommended to override this in dialects for databases which support localtimestamp or current_timestamp at local.

currentTimestampWithTimeZone

public String currentTimestampWithTimeZone()

Translation of the HQL offset_datetime function, which maps to the Java type OffsetDateTime which is a datetime with a time zone. This in principle
correctly maps to the ANSI SQL current_timestamp which has the type TIMESTAMP WITH TIME ZONE.

extractPattern

public String extractPattern​(TemporalUnit unit)

Obtain a pattern for the SQL equivalent to an extract() function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.

This method does not need to handle TemporalUnit.NANOSECOND, TemporalUnit.NATIVE, TemporalUnit.OFFSET, TemporalUnit.DATE, TemporalUnit.TIME,
TemporalUnit.WEEK_OF_YEAR, or TemporalUnit.WEEK_OF_MONTH, which are already desugared by ExtractFunction.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 20/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Parameters:
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
unit - the first argument
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

castPattern

public String castPattern​(CastType from, CastType to)

Obtain a pattern for the SQL equivalent to a cast() function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.

Parameters:
from - a CastType indicating the type of the value argument

to - a CastType indicating the type the value argument is cast to

trimPattern

@Deprecated(forRemoval=true) public String trimPattern​(TrimSpec specification, char character)

Deprecated, for removal: This API element is subject to removal in a future version.
Use trimPattern(TrimSpec, boolean) instead.

Obtain a pattern for the SQL equivalent to a trim() function call. The resulting pattern must contain a ?1 placeholder for the argument of type String.

Parameters:
specification - leading or trailing

character - the character to trim

trimPattern

public String trimPattern​(TrimSpec specification, boolean isWhitespace)

Obtain a pattern for the SQL equivalent to a trim() function call. The resulting pattern must contain a ?1 placeholder for the argument of type String
and a ?2 placeholder for the trim character if isWhitespace was false.

Parameters:
specification - leading, trailing or both

isWhitespace - true if the trim character is a whitespace and can be omitted, false if it must be explicit and a ?2 placeholder should be included in the
pattern

supportsFractionalTimestampArithmetic

public boolean supportsFractionalTimestampArithmetic()

Whether the database supports adding a fractional interval to a timestamp, for example timestamp + 0.5 second.

timestampdiffPattern

public String timestampdiffPattern​(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType)

Obtain a pattern for the SQL equivalent to a timestampdiff() function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the
arguments.

Parameters:
unit - the first argument

fromTemporalType - true if the first argument is a timestamp, false if a date

toTemporalType - true if the second argument is

timestampaddPattern

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 21/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
public String timestampaddPattern​(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType)
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Obtain a pattern for the SQL equivalent to a timestampadd() function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the
ALL CLASSES SEARCH:
arguments.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Parameters:
unit - The unit to add to the temporal

temporalType - The type of the temporal

intervalType - The type of interval to add or null if it's not a native interval

equivalentTypes

public boolean equivalentTypes​(int typeCode1, int typeCode2)

Do the given JDBC type codes, as defined in Types represent essentially the same type in this dialect of SQL?

The default implementation treats NUMERIC and DECIMAL as the same type, and FLOAT, REAL, and DOUBLE as essentially the same type, since the ANSI SQL
specification fails to meaningfully distinguish them.

The default implementation also treats VARCHAR, NVARCHAR, LONGVARCHAR, and LONGNVARCHAR as the same type, and BINARY and LONGVARBINARY as the same
type, since Hibernate doesn't really differentiate these types.

Parameters:
typeCode1 - the first column type info

typeCode2 - the second column type info

Returns:
true if the two type codes are equivalent

getDefaultProperties

public Properties getDefaultProperties()

Retrieve a set of default Hibernate properties for this database.

An implementation may set configuration properties from initDefaultProperties(), though it is discouraged.

Returns:
a set of Hibernate configuration properties

See Also:
initDefaultProperties()

getDefaultStatementBatchSize

public int getDefaultStatementBatchSize()

The default value to use for the configuration property "hibernate.jdbc.batch_size".

getDefaultNonContextualLobCreation

public boolean getDefaultNonContextualLobCreation()

The default value to use for the configuration property "hibernate.jdbc.lob.non_contextual_creation".

getDefaultUseGetGeneratedKeys

public boolean getDefaultUseGetGeneratedKeys()

The default value to use for the configuration property "hibernate.jdbc.use_get_generated_keys".

toString

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 22/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
public String toString()
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Overrides:
ALL CLASSES SEARCH:
toString in class Object
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

contribute

public void contribute​(TypeContributions typeContributions, ServiceRegistry serviceRegistry)

Description copied from interface: TypeContributor


Contribute types

Specified by:
contribute in interface TypeContributor

Parameters:
typeContributions - The callback for adding contributed types

serviceRegistry - The service registry

contributeTypes

public void contributeTypes​(TypeContributions typeContributions, ServiceRegistry serviceRegistry)

A callback which allows the Dialect to contribute types.

Parameters:
typeContributions - Callback to contribute the types

serviceRegistry - The service registry

getLobMergeStrategy

public LobMergeStrategy getLobMergeStrategy()

Get the LobMergeStrategy to use, NEW_LOCATOR_LOB_MERGE_STRATEGY by default.

getNativeIdentifierGeneratorStrategy

public String getNativeIdentifierGeneratorStrategy()

The name identifying the "native" id generation strategy for this dialect.

This is the name of the id generation strategy which should be used when "native" is specified in hbm.xml.

Returns:
The name identifying the native generator strategy.

getIdentityColumnSupport

public IdentityColumnSupport getIdentityColumnSupport()

Get the appropriate IdentityColumnSupport for this dialect.

Returns:
the IdentityColumnSupport

Since:
5.1

getSequenceSupport

public SequenceSupport getSequenceSupport()

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 23/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Get the appropriate SequenceSupport for this dialect.
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES SEARCH:


SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
getQuerySequencesString

public String getQuerySequencesString()

Get the select command used retrieve the names of all sequences.

Returns:
The select command; or null if sequences are not supported.

getSequenceInformationExtractor

public SequenceInformationExtractor getSequenceInformationExtractor()

A SequenceInformationExtractor which is able to extract SequenceInformation from the JDBC result set returned when getQuerySequencesString()
is executed.

getSelectGUIDString

public String getSelectGUIDString()

Get the command used to select a GUID from the database.

Optional operation.

Returns:
The appropriate command.

supportsTemporaryTables

public boolean supportsTemporaryTables()

Does this database have some sort of support for temporary tables?

Returns:
true by default, since most do

supportsTemporaryTablePrimaryKey

public boolean supportsTemporaryTablePrimaryKey()

Does this database support primary keys for temporary tables?

Returns:
true by default, since most do

getLimitHandler

public LimitHandler getLimitHandler()

Obtain a LimitHandler that implements pagination support for Query.setMaxResults(int) and Query.setFirstResult(int).

supportsLockTimeouts

public boolean supportsLockTimeouts()

Does this dialect support specifying timeouts when requesting locks.

Returns:
True is this dialect supports specifying lock timeouts.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 24/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

isLockTimeoutParameterized
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
@Deprecated(since="6", forRemoval=true) public boolean isLockTimeoutParameterized()

Deprecated, for removal: This API element is subject to removal in a future version.
This is never called, and since at least Hibernate 5 has just returned false in every dialect. It will be removed.

If this dialect supports specifying lock timeouts, are those timeouts rendered into the SQL string as parameters? The implication is that Hibernate will
need to bind the timeout value as a parameter in the PreparedStatement. If true, the parameter position is always handled as the last parameter; if the
dialect specifies the lock timeout elsewhere in the SQL statement then the timeout value should be directly rendered into the statement and this method
should return false.

Returns:
True if the lock timeout is rendered into the SQL string as a parameter; false otherwise.

getLockingStrategy

public LockingStrategy getLockingStrategy​(Lockable lockable, LockMode lockMode)

A LockingStrategy which is able to acquire a database-level lock with the specified level.

Parameters:
lockable - The persister for the entity to be locked.

lockMode - The type of lock to be acquired.

Returns:
The appropriate locking strategy.
Since:
3.2

getForUpdateString

public String getForUpdateString​(LockOptions lockOptions)

Given a set of LockOptions (lock level, timeout), determine the appropriate for update fragment to use to obtain the lock.

Parameters:
lockOptions - contains the lock mode to apply.

Returns:
The appropriate for update fragment.

getForUpdateString

public String getForUpdateString​(LockMode lockMode)

Given a LockMode, determine the appropriate for update fragment to use to obtain the lock.

Parameters:
lockMode - The lock mode to apply.

Returns:
The appropriate for update fragment.

getForUpdateString

public String getForUpdateString()

Get the string to append to SELECT statements to acquire pessimistic UPGRADE locks for this dialect.

Returns:
The appropriate FOR UPDATE clause string.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 25/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

getWriteLockString
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
public String getWriteLockString​(int timeout)

Get the string to append to SELECT statements to acquire pessimistic WRITE locks for this dialect.

Location of the returned string is treated the same as getForUpdateString().

Parameters:
timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.

Returns:
The appropriate LOCK clause string.

getWriteLockString

public String getWriteLockString​(String aliases, int timeout)

Get the string to append to SELECT statements to acquire WRITE locks for this dialect, given the aliases of the columns to be write locked.

Location of the returned string is treated the same as getForUpdateString().

Parameters:
aliases - The columns to be read locked.

timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.

Returns:
The appropriate LOCK clause string.

getReadLockString

public String getReadLockString​(int timeout)

Get the string to append to SELECT statements to acquire READ locks for this dialect.

Location of the returned string is treated the same as getForUpdateString().

Parameters:
timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.

Returns:
The appropriate LOCK clause string.

getReadLockString

public String getReadLockString​(String aliases, int timeout)

Get the string to append to SELECT statements to acquire READ locks for this dialect, given the aliases of the columns to be read locked.

Location of the returned string is treated the same as getForUpdateString().

Parameters:
aliases - The columns to be read locked.

timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.

Returns:
The appropriate LOCK clause string.

getWriteRowLockStrategy

public RowLockStrategy getWriteRowLockStrategy()

The row lock strategy to use for write locks.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 26/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

getReadRowLockStrategy
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public RowLockStrategy getReadRowLockStrategy() SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
The row lock strategy to use for read locks.

supportsOuterJoinForUpdate

public boolean supportsOuterJoinForUpdate()

Does this dialect support FOR UPDATE in conjunction with outer-joined rows?

Returns:
True if outer-joined rows can be locked via FOR UPDATE.

getForUpdateString

public String getForUpdateString​(String aliases)

Get the FOR UPDATE OF column_list fragment appropriate for this dialect, given the aliases of the columns to be write locked.

Parameters:
aliases - The columns to be write locked.

Returns:
The appropriate FOR UPDATE OF column_list clause string.

getForUpdateString

public String getForUpdateString​(String aliases, LockOptions lockOptions)

Get the FOR UPDATE OF or FOR SHARE OF fragment appropriate for this dialect, given the aliases of the columns to be locked.

Parameters:
aliases - The columns to be locked.

lockOptions - the lock options to apply

Returns:
The appropriate FOR UPDATE OF column_list clause string.

getForUpdateNowaitString

public String getForUpdateNowaitString()

Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.

Returns:
The appropriate FOR UPDATE NOWAIT clause string.

getForUpdateSkipLockedString

public String getForUpdateSkipLockedString()

Retrieves the FOR UPDATE SKIP LOCKED syntax specific to this dialect.

Returns:
The appropriate FOR UPDATE SKIP LOCKED clause string.

getForUpdateNowaitString

public String getForUpdateNowaitString​(String aliases)

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 27/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect, given the aliases of the columns to be write locked.
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Parameters:
ALL CLASSES SEARCH:
aliases - The columns to be write locked.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Returns:
The appropriate FOR UPDATE OF colunm_list NOWAIT clause string.

getForUpdateSkipLockedString

public String getForUpdateSkipLockedString​(String aliases)

Get the FOR UPDATE OF column_list SKIP LOCKED fragment appropriate for this dialect, given the aliases of the columns to be write locked.

Parameters:
aliases - The columns to be write locked.

Returns:
The appropriate FOR UPDATE colunm_list SKIP LOCKED clause string.

appendLockHint

public String appendLockHint​(LockOptions lockOptions, String tableName)

Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause.

Parameters:
lockOptions - The lock options to apply

tableName - The name of the table to which to apply the lock hint.

Returns:
The table with any required lock hints.

applyLocksToSql

public String applyLocksToSql​(String sql, LockOptions aliasedLockOptions, Map<String,​


String[]> keyColumnNames)

Modifies the given SQL, applying the appropriate updates for the specified lock modes and key columns.

This allows emulation of SELECT FOR UPDATE for dialects which do not support the standard syntax.

Parameters:
sql - the SQL string to modify

aliasedLockOptions - lock options indexed by aliased table names.

keyColumnNames - a map of key columns indexed by aliased table names.

Returns:
the modified SQL string.

getTimeoutInSeconds

protected int getTimeoutInSeconds​(int millis)

getCreateTableString

public String getCreateTableString()

The command used to create a table, usually create table.

Returns:
The command used to create a table.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 28/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

getTableTypeString
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public String getTableTypeString() SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
An arbitrary fragment appended to the end of the create table statement.

API Note:
An example is the MySQL engine option specifying a storage engine.

supportsIfExistsBeforeTableName

public boolean supportsIfExistsBeforeTableName()

For dropping a table, can the phrase if exists be applied before the table name?

Returns:
true if if exists can be applied before the table name

API Note:
Only one or the other (or neither) of this and supportsIfExistsAfterTableName() should return true.

supportsIfExistsAfterTableName

public boolean supportsIfExistsAfterTableName()

For dropping a table, can the phrase if exists be applied after the table name?

Returns:
true if if exists can be applied after the table name

API Note:
Only one or the other (or neither) of this and supportsIfExistsBeforeTableName() should return true.

getDropTableString

public String getDropTableString​(String tableName)

The command used to drop a table with the given name, usually drop table tab_name.

Parameters:
tableName - The name of the table to drop

Returns:
The drop table statement as a string

getCreateIndexString

public String getCreateIndexString​(boolean unique)

The command used to create an index, usually create index or create unique index.

Parameters:
unique - true if the index is a unique index

Returns:
The command used to create an index.

getCreateIndexTail

public String getCreateIndexTail​(boolean unique, List<Column> columns)

A string to be appended to the end of the create index command, usually to specify that null values are to be considered distinct.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 29/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

qualifyIndexName
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public boolean qualifyIndexName() SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Do we need to qualify index names with the schema name?

Returns:
true if we do

getCreateMultisetTableString

public String getCreateMultisetTableString()

Slight variation on getCreateTableString(). Here, we have the command used to create a table when there is no primary key and duplicate rows are
expected.

Returns:
The command used to create a multiset table.

API Note:
Most databases do not have this distinction; this method was originally added for Teradata which does.

hasAlterTable

public boolean hasAlterTable()

Does this dialect support the ALTER TABLE syntax?

Returns:
True if we support altering existing tables; false otherwise.

getAlterTableString

public String getAlterTableString​(String tableName)

The command used to alter a table with the given name, usually alter table tab_name or alter table tab_name if exists.

We prefer the if exists form if supported.

Parameters:
tableName - The name of the table to alter

Returns:
The command used to alter a table.
Since:
5.2.11

supportsIfExistsAfterAlterTable

public boolean supportsIfExistsAfterAlterTable()

For an alter table, can the phrase if exists be applied?

Returns:
true if if exists can be applied after alter table

Since:
5.2.11

getAddColumnString

public String getAddColumnString()

The subcommand of the alter table command used to add a column to a table, usually add column or add.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 30/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Returns:
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
The add column fragment.
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

getAddColumnSuffixString

public String getAddColumnSuffixString()

The syntax for the suffix used to add a column to a table.

Returns:
The suffix of the add column fragment.

dropConstraints

public boolean dropConstraints()

Do we need to drop constraints before dropping tables in this dialect?

Returns:
True if constraints must be dropped prior to dropping the table; false otherwise.

getDropForeignKeyString

public String getDropForeignKeyString()

The subcommand of the alter table command used to drop a foreign key constraint, usually drop constraint.

getDropUniqueKeyString

public String getDropUniqueKeyString()

The subcommand of the alter table command used to drop a unique key constraint.

supportsIfExistsBeforeConstraintName

public boolean supportsIfExistsBeforeConstraintName()

For dropping a constraint with an alter table statement, can the phrase if exists be applied before the constraint name?

Returns:
true if if exists can be applied before the constraint name

API Note:
Only one or the other (or neither) of this and supportsIfExistsAfterConstraintName() should return true

supportsIfExistsAfterConstraintName

public boolean supportsIfExistsAfterConstraintName()

For dropping a constraint with an alter table, can the phrase if exists be applied after the constraint name?

Returns:
true if if exists can be applied after the constraint name

API Note:
Only one or the other (or neither) of this and supportsIfExistsBeforeConstraintName() should return true.

supportsAlterColumnType

public boolean supportsAlterColumnType()

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 31/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Does this dialect support modifying the type of an existing column?
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES SEARCH:


SUMMARY: NESTED | FIELD | CONSTR | METHOD
getAlterColumnTypeString DETAIL: FIELD | CONSTR | METHOD

public String getAlterColumnTypeString​(String columnName, String columnType, String columnDefinition)

The fragment of an alter table command which modifies a column type, or null if column types cannot be modified. Often alter column col_name set
data type col_type.

Parameters:
columnName - the name of the column

columnType - the new type of the column

columnDefinition - the full column definition

Returns:
a fragment to be appended to alter table

getAddForeignKeyConstraintString

public String getAddForeignKeyConstraintString​(String constraintName, String[] foreignKey, String referencedTable,


String[] primaryKey, boolean referencesPrimaryKey)

The syntax used to add a foreign key constraint to a table, with the referenced key columns explicitly specified.

Parameters:
constraintName - The foreign key constraint name

foreignKey - The names of the columns comprising the foreign key

referencedTable - The table referenced by the foreign key

primaryKey - The explicit columns in the referencedTable referenced by this foreign key.

referencesPrimaryKey - if false, constraint should be explicit about which column names the constraint refers to

Returns:
the "add FK" fragment

getAddForeignKeyConstraintString

public String getAddForeignKeyConstraintString​(String constraintName, String foreignKeyDefinition)

The syntax used to add a foreign key constraint to a table, given the definition of the foreign key as a string.

Parameters:
constraintName - The foreign key constraint name

foreignKeyDefinition - The whole definition of the foreign key as a fragment

getAddPrimaryKeyConstraintString

public String getAddPrimaryKeyConstraintString​(String constraintName)

The syntax used to add a primary key constraint to a table.

Parameters:
constraintName - The name of the PK constraint.

Returns:
The "add PK" fragment

getFallbackSqmMutationStrategy

public SqmMultiTableMutationStrategy getFallbackSqmMutationStrategy​


(EntityMappingType entityDescriptor,
RuntimeModelCreationContext runtimeModelCreationContext)

The SqmMultiTableMutationStrategy to use when not specified by QueryEngineOptions.getCustomSqmMultiTableMutationStrategy().

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 32/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
See Also:
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
SqmMultiTableMutationStrategyProvider.createMutationStrategy(org.hibernate.metamodel.mapping.EntityMappingType,
ALL CLASSES
org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess) SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

getFallbackSqmInsertStrategy

public SqmMultiTableInsertStrategy getFallbackSqmInsertStrategy​


(EntityMappingType entityDescriptor,
RuntimeModelCreationContext runtimeModelCreationContext)

The SqmMultiTableInsertStrategy to use when not specified by QueryEngineOptions.getCustomSqmMultiTableInsertStrategy().

See Also:
SqmMultiTableMutationStrategyProvider.createInsertStrategy(org.hibernate.metamodel.mapping.EntityMappingType,
org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess)

getCreateUserDefinedTypeKindString

public String getCreateUserDefinedTypeKindString()

The kind of user-defined type to create, or the empty string if this does not need to be specified. Included after create type type_name as, but before
the list of members.

getCreateUserDefinedTypeExtensionsString

public String getCreateUserDefinedTypeExtensionsString()

An arbitrary extension to append to the end of the UDT create type command.

supportsIfExistsBeforeTypeName

public boolean supportsIfExistsBeforeTypeName()

For dropping a type, can the phrase if exists be applied before the type name?

Returns:
true if if exists can be applied before the type name

API Note:
Only one or the other (or neither) of this and supportsIfExistsAfterTypeName() should return true.

supportsIfExistsAfterTypeName

public boolean supportsIfExistsAfterTypeName()

For dropping a type, can the phrase if exists be applied after the type name?

Returns:
true if if exists can be applied after the type name

API Note:
Only one or the other (or neither) of this and supportsIfExistsBeforeTypeName() should return true.

registerResultSetOutParameter

public int registerResultSetOutParameter​(CallableStatement statement, int position) throws SQLException

Registers a parameter capable of returning a ResultSet by position, either an OUT parameter, or a REF_CURSOR parameter as defined in Java 8.

Parameters:
statement - The callable statement.

position - The bind position at which to register the output param.

Returns:

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 33/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
The number of (contiguous) bind positions used.
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
Throws:
ALL CLASSES SEARCH:
SQLException - Indicates problems registering the param.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
API Note:
Before Java 8, support for ResultSet-returning parameters was very uneven across database and drivers, leading to its inclusion as part of the Dialect
contract.

registerResultSetOutParameter

public int registerResultSetOutParameter​(CallableStatement statement, String name) throws SQLException

Registers a parameter capable of returning a ResultSet by name, either an OUT parameter, or a REF_CURSOR parameter as defined in Java 8.

Parameters:
statement - The callable statement.

name - The parameter name (for drivers which support named parameters).

Returns:
The number of (contiguous) bind positions used.
Throws:
SQLException - Indicates problems registering the param.

API Note:
Before Java 8, support for ResultSet-returning parameters was very uneven across database and drivers, leading to its inclusion as part of the Dialect
contract.

getResultSet

public ResultSet getResultSet​(CallableStatement statement) throws SQLException

Given a callable statement previously processed by registerResultSetOutParameter(java.sql.CallableStatement, int), extract the ResultSet from
the OUT parameter.

Parameters:
statement - The callable statement.

Returns:
The extracted result set.

Throws:
SQLException - Indicates problems extracting the result set.

getResultSet

public ResultSet getResultSet​(CallableStatement statement, int position) throws SQLException

Given a callable statement previously processed by registerResultSetOutParameter(java.sql.CallableStatement, int), extract the ResultSet from
the positional OUT parameter.

Parameters:
statement - The callable statement.

position - The bind position at which to register the output param.

Returns:
The extracted result set.

Throws:
SQLException - Indicates problems extracting the result set.

getResultSet

public ResultSet getResultSet​(CallableStatement statement, String name) throws SQLException

Given a callable statement previously processed by registerResultSetOutParameter(java.sql.CallableStatement, int), extract the ResultSet from
the named OUT parameter.
https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 34/66
09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Parameters:
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
statement - The callable statement.
ALL CLASSES SEARCH:
name - The parameter name (for drivers which support named parameters).
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Returns:
The extracted result set.

Throws:
SQLException - Indicates problems extracting the result set.

supportsCurrentTimestampSelection

public boolean supportsCurrentTimestampSelection()

Does this dialect support some way to retrieve the current timestamp value from the database?

Returns:
True if the current timestamp can be retrieved; false otherwise.

isCurrentTimestampSelectStringCallable

public boolean isCurrentTimestampSelectStringCallable()

Is the command returned by getCurrentTimestampSelectString() treated as callable?

Typically, this indicates the use of the JDBC escape syntax.

Returns:
if the getCurrentTimestampSelectString() is treated as callable; false otherwise.

getCurrentTimestampSelectString

public String getCurrentTimestampSelectString()

The command used to retrieve the current timestamp from the database.

supportsStandardCurrentTimestampFunction

public boolean supportsStandardCurrentTimestampFunction()

Does this dialect have an ANSI SQL current_timestamp function?

buildSQLExceptionConversionDelegate

public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()

An instance of SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.

If this method is overridden to return a non-null value, the default SQLExceptionConverter will use the returned SQLExceptionConversionDelegate in
addition to the following standard delegates:

1. a "static" delegate based on the JDBC4-defined SQLException hierarchy, and


2. a delegate that interprets SQLState codes as either X/Open or SQL-2003 codes, depending on what is reported by the JDBC driver.

It is strongly recommended that every Dialect implementation override this method, since interpretation of a SQL error is much more accurate when
based on the vendor-specific error code, rather than on the SQLState.

Returns:
The SQLExceptionConversionDelegate for this dialect

getViolatedConstraintNameExtractor

public ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor()

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 35/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
A ViolatedConstraintNameExtractor for extracting the name of a violated constraint from a SQLException.
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Specified by:
ALL CLASSES SEARCH:
getViolatedConstraintNameExtractor in interface ConversionContext
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

getSelectClauseNullString

public String getSelectClauseNullString​(int sqlType, TypeConfiguration typeConfiguration)

Given a JDBC type code, return the expression for a literal null value of that type, to use in a select clause.

The select query will be an element of a UNION or UNION ALL.

Parameters:
sqlType - The Types type code.

typeConfiguration - The type configuration

Returns:
The appropriate select clause value fragment.

Implementation Note:
Some databases require an explicit type cast.

supportsUnionAll

public boolean supportsUnionAll()

Does this dialect support UNION ALL?

Returns:
True if UNION ALL is supported; false otherwise.

supportsUnionInSubquery

public boolean supportsUnionInSubquery()

Does this dialect support UNION in a subquery.

Returns:
True if UNION is supported in a subquery; false otherwise.

getNoColumnsInsertString

@Deprecated(since="6") public String getNoColumnsInsertString()

Deprecated.
Override the method renderInsertIntoNoColumns() on the translator returned by this dialect.

The fragment used to insert a row without specifying any column values, usually just (), but sometimes default values.

Returns:
The appropriate empty values clause.

Implementation Note:
On the other hand, this is simply not possible on some databases!

supportsNoColumnsInsert

public boolean supportsNoColumnsInsert()

Is the INSERT statement is allowed to contain no columns?

Returns:

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 36/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
if this dialect supports no-column INSERT.
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES SEARCH:


SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
getLowercaseFunction

public String getLowercaseFunction()

The name of the SQL function that transforms a string to lowercase, almost always lower.

Returns:
The dialect-specific lowercase function.

getCaseInsensitiveLike

public String getCaseInsensitiveLike()

The name of the SQL operator that performs case-insensitive LIKE comparisons.

Returns:
The dialect-specific case-insensitive like operator.

supportsCaseInsensitiveLike

public boolean supportsCaseInsensitiveLike()

Does this dialect support case-insensitive LIKE comparisons?

Returns:
true if the database supports case-insensitive like comparisons, false otherwise. The default is false.

supportsTruncateWithCast

public boolean supportsTruncateWithCast()

Does this dialect support truncation of values to a specified length via a cast?

Returns:
true if the database supports truncation via a cast, false otherwise. The default is true.

supportsIsTrue

public boolean supportsIsTrue()

Does this dialect support the is true and is false operators?

Returns:
true if the database supports is true and is false, or false if it does not. The default is is false.

transformSelectString

public String transformSelectString​(String select)

Meant as a means for end users to affect the select strings being sent to the database and perhaps manipulate them in some fashion.

Parameters:
select - The select command

Returns:
The mutated select command, or the same as was passed in.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 37/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

getMaxAliasLength
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public int getMaxAliasLength() SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
What is the maximum length Hibernate can use for generated aliases?

Returns:
The maximum length.
Implementation Note:
The maximum here should account for the fact that Hibernate often needs to append "uniqueing" information to the end of generated aliases. That
"uniqueing" information will be added to the end of an identifier generated to the length specified here; so be sure to leave some room (generally speaking
5 positions will suffice).

getMaxIdentifierLength

public int getMaxIdentifierLength()

What is the maximum identifier length supported by this dialect?

Returns:
The maximum length.

toBooleanValueString

public String toBooleanValueString​(boolean bool)

The SQL literal expression representing the given boolean value.

Parameters:
bool - The boolean value

Returns:
The appropriate SQL literal.

appendBooleanValueString

public void appendBooleanValueString​(SqlAppender appender, boolean bool)

Append the SQL literal expression representing the given boolean value to the given SqlAppender.

Parameters:
bool - The boolean value

appender - The SqlAppender to append the literal expression to

registerKeyword

protected void registerKeyword​(String word)

Register a keyword.

Parameters:
word - a reserved word in this SQL dialect

getKeywords

public Set<String> getKeywords()

The keywords of this SQL dialect.

buildIdentifierHelper

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 38/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
public IdentifierHelper buildIdentifierHelper​(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

The IdentifierHelper indicated by this dialect for handling identifier conversions. Returning null is allowed and indicates that Hibernate should fall
ALL CLASSES SEARCH:
back to building a "standard" helper. In the fallback path, any changes made to the IdentifierHelperBuilder during this call will still be incorporated into
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
the built IdentifierHelper.

The incoming builder will have the following set:

IdentifierHelperBuilder.isGloballyQuoteIdentifiers()
IdentifierHelperBuilder.getUnquotedCaseStrategy() - initialized to UPPER
IdentifierHelperBuilder.getQuotedCaseStrategy() - initialized to MIXED

By default, Hibernate will do the following:

Call IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
Call IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
Applies AnsiSqlKeywords.sql2003() as reserved words
Applies the {#link #sqlKeywords} collected here as reserved words
Applies the Dialect's NameQualifierSupport, if it defines one

Parameters:
builder - A partially-configured IdentifierHelperBuilder.

dbMetaData - Access to the metadata returned from the driver if needed and if available. WARNING: it may be null.

Returns:
The IdentifierHelper instance to use, or null to indicate Hibernate should use its fallback path

Throws:
SQLException - Accessing the DatabaseMetaData can throw it. Just rethrow and Hibernate will handle it.

See Also:
getNameQualifierSupport()

openQuote

public char openQuote()

The character specific to this dialect used to begin a quoted identifier.

Returns:
The dialect-specific open quote character.

closeQuote

public char closeQuote()

The character specific to this dialect used to close a quoted identifier.

Returns:
The dialect-specific close quote character.

toQuotedIdentifier

public String toQuotedIdentifier​(String name)

Apply dialect-specific quoting.

Parameters:
name - The value to be quoted.

Returns:
The quoted value.

See Also:
openQuote(), closeQuote()

quote

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 39/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
public String quote​(String name)
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Apply dialect-specific quoting if the given name is quoted using backticks.


ALL CLASSES SEARCH:

By default,
SUMMARY: NESTEDthe incoming
| FIELD name
| CONSTR is checkedDETAIL:
| METHOD to seeFIELD
if its |first character
CONSTR is a backtick (`). If it is, the dialect specific quoting is applied.
| METHOD

Parameters:
name - The value to be quoted.

Returns:
The quoted (or unmodified, if not starting with backtick) value.

See Also:
openQuote(), closeQuote()

getFallbackSchemaManagementTool

@Incubating public SchemaManagementTool getFallbackSchemaManagementTool​


(Map<String,​
Object> configurationValues,
ServiceRegistryImplementor registry)

The SchemaManagementTool to use if none is explicitly specified.

Returns:
a HibernateSchemaManagementTool by default

API Note:
Allows implementations to override how schema tooling works by default

getTableExporter

public Exporter<Table> getTableExporter()

Get an Exporter for Tables, usually StandardTableExporter.

getTableMigrator

public TableMigrator getTableMigrator()

Get a TableMigrator, usually StandardTableMigrator.

getTableCleaner

public Cleaner getTableCleaner()

Get a schema Cleaner, usually StandardTableCleaner.

getUserDefinedTypeExporter

public Exporter<UserDefinedType> getUserDefinedTypeExporter()

Get an Exporter for UserDefinedTypes, usually StandardUserDefinedTypeExporter.

getSequenceExporter

public Exporter<Sequence> getSequenceExporter()

Get an Exporter for Sequences, usually StandardSequenceExporter.

getIndexExporter

public Exporter<Index> getIndexExporter()

Get an Exporter for Indexes, usually StandardIndexExporter.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 40/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

getForeignKeyExporter
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
public Exporter<ForeignKey> getForeignKeyExporter()

Get an Exporter for ForeignKeys, usually StandardForeignKeyExporter.

getUniqueKeyExporter

public Exporter<Constraint> getUniqueKeyExporter()

Get an Exporter for unique key Constraints, usually StandardUniqueKeyExporter.

getAuxiliaryDatabaseObjectExporter

public Exporter<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectExporter()

Get an Exporter for AuxiliaryDatabaseObjects, usually StandardAuxiliaryDatabaseObjectExporter.

getTemporaryTableExporter

public TemporaryTableExporter getTemporaryTableExporter()

Get a TemporaryTableExporter, usually StandardTemporaryTableExporter.

getSupportedTemporaryTableKind

public TemporaryTableKind getSupportedTemporaryTableKind()

The kind of temporary tables that are supported on this database.

getTemporaryTableCreateOptions

public String getTemporaryTableCreateOptions()

An arbitrary SQL fragment appended to the end of the statement to create a temporary table, specifying dialect-specific options, or null if there are no
options to specify.

getTemporaryTableCreateCommand

public String getTemporaryTableCreateCommand()

The command to create a temporary table.

getTemporaryTableDropCommand

public String getTemporaryTableDropCommand()

The command to drop a temporary table.

getTemporaryTableTruncateCommand

public String getTemporaryTableTruncateCommand()

The command to truncate a temporary table.

getCreateTemporaryTableColumnAnnotation

public String getCreateTemporaryTableColumnAnnotation​(int sqlTypeCode)

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 41/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Annotation to be appended to the end of each COLUMN clause for temporary tables.
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Parameters:
ALL CLASSES SEARCH:
sqlTypeCode - The SQL type code
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Returns:
The annotation to be appended, for example, COLLATE DATABASE_DEFAULT in SQL Server

getTemporaryTableDdlTransactionHandling

public TempTableDdlTransactionHandling getTemporaryTableDdlTransactionHandling()

The sort of transaction handling to use when creating or dropping temporary tables.

getTemporaryTableAfterUseAction

public AfterUseAction getTemporaryTableAfterUseAction()

The action to take after finishing use of a temporary table.

getTemporaryTableBeforeUseAction

public BeforeUseAction getTemporaryTableBeforeUseAction()

The action to take before beginning use of a temporary table.

canCreateCatalog

public boolean canCreateCatalog()

Does this dialect support creating and dropping catalogs?

Returns:
True if the dialect supports catalog creation; false otherwise.

getCreateCatalogCommand

public String[] getCreateCatalogCommand​(String catalogName)

Get the SQL command used to create the named catalog.

Parameters:
catalogName - The name of the catalog to be created.

Returns:
The creation commands

getDropCatalogCommand

public String[] getDropCatalogCommand​(String catalogName)

Get the SQL command used to drop the named catalog.

Parameters:
catalogName - The name of the catalog to be dropped.

Returns:
The drop commands

canCreateSchema

public boolean canCreateSchema()

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 42/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Does this dialect support creating and dropping schema?
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Returns:
ALL CLASSES SEARCH:
True if the dialect supports schema creation; false otherwise.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

getCreateSchemaCommand

public String[] getCreateSchemaCommand​(String schemaName)

Get the SQL command used to create the named schema.

Parameters:
schemaName - The name of the schema to be created.

Returns:
The creation commands

getDropSchemaCommand

public String[] getDropSchemaCommand​(String schemaName)

Get the SQL command used to drop the named schema.

Parameters:
schemaName - The name of the schema to be dropped.

Returns:
The drop commands

getCurrentSchemaCommand

public String getCurrentSchemaCommand()

Get the SQL command used to retrieve the current schema name.

Works in conjunction with getSchemaNameResolver(), unless the resulting SchemaNameResolver does not need this information. For example, a custom
implementation might make use of the Java 1.7 Connection.getSchema() method.

Returns:
The current schema retrieval SQL

getSchemaNameResolver

public SchemaNameResolver getSchemaNameResolver()

Get the strategy for determining the schema name from a JDBC Connection, usually DefaultSchemaNameResolver.

Returns:
The schema name resolver strategy

hasSelfReferentialForeignKeyBug

public boolean hasSelfReferentialForeignKeyBug()

Does the database/driver have bug in deleting rows that refer to other rows being deleted in the same query?

Returns:
true if the database/driver has this bug

Implementation Note:
The main culprit is MySQL.

getNullColumnString

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 43/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
public String getNullColumnString()
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

The keyword used to specify a nullable column, usually "", but sometimes " null".
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

getNullColumnString

public String getNullColumnString​(String columnType)

The keyword used to specify a nullable column of the given SQL type.

Implementation Note:
The culprit is timestamp columns on MySQL.

quoteCollation

public String quoteCollation​(String collation)

Quote the given collation name if necessary.

supportsCommentOn

public boolean supportsCommentOn()

Does this dialect support commenting on tables and columns?

Returns:
true if commenting is supported

getTableComment

public String getTableComment​(String comment)

Get the comment into a form supported for table definition.

Parameters:
comment - The comment to apply

Returns:
The comment fragment

getUserDefinedTypeComment

public String getUserDefinedTypeComment​(String comment)

Get the comment into a form supported for UDT definition.

Parameters:
comment - The comment to apply

Returns:
The comment fragment

getColumnComment

public String getColumnComment​(String comment)

Get the comment into a form supported for column definition.

Parameters:
comment - The comment to apply

Returns:
The comment fragment

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 44/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

supportsColumnCheck
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
public boolean supportsColumnCheck()

Does this dialect support column-level check constraints?

Returns:
True if column-level check constraints are supported; false otherwise.

supportsTableCheck

public boolean supportsTableCheck()

Does this dialect support table-level check constraints?

Returns:
True if table-level check constraints are supported; false otherwise.

supportsCascadeDelete

public boolean supportsCascadeDelete()

Does this dialect support on delete actions in foreign key definitions?

Returns:
true if the dialect does support the on delete clause.

getCascadeConstraintsString

public String getCascadeConstraintsString()

The keyword that specifies that a drop table operation should be cascaded to its constraints, typically " cascade" where the leading space is required,
or the empty string if there is no such keyword in this dialect.

Returns:
The cascade drop keyword, if any, with a leading space

getColumnAliasExtractor

public ColumnAliasExtractor getColumnAliasExtractor()

A ColumnAliasExtractor, usually just ResultSetMetaData.getColumnLabel(int).

useInputStreamToInsertBlob

public boolean useInputStreamToInsertBlob()

Should LOBs (both BLOB and CLOB) be bound using stream operations, that is, using PreparedStatement.setBinaryStream(int,
java.io.InputStream, int)).

Returns:
True if BLOBs and CLOBs should be bound using stream operations.

Since:
3.2

supportsParametersInInsertSelect

@Deprecated(since="6", forRemoval=true) public boolean supportsParametersInInsertSelect()

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 45/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

Deprecated,
OVERVIEW PACKAGEforCLASS
removal:
USEThisTREE
API element is subject
DEPRECATED INDEXto removal
HELP in a future version.
This seems to be supported on all platforms, and we don't call this except in test suite
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Does this dialect support parameters within the SELECT clause of INSERT ... SELECT ... statements?

Returns:
True if this is supported; false otherwise.
Since:
3.2

supportsOrdinalSelectItemReference

public boolean supportsOrdinalSelectItemReference()

Does this dialect support references to result variables (i.e, select items) by column positions (1-origin) as defined by the select clause?

Returns:
true if result variable references by column positions are supported; false otherwise.

Since:
6.0.0

getNullOrdering

public NullOrdering getNullOrdering()

Returns the default ordering of null.

Since:
6.0.0

supportsNullPrecedence

public boolean supportsNullPrecedence()

Does this dialect support nulls first and nulls last?

isAnsiNullOn

@Deprecated(since="6") public boolean isAnsiNullOn()

Deprecated.
This is only called from SybaseASESqlAstTranslator so it doesn't need to be declared here.

A setting specific to SybaseASEDialect.

requiresCastForConcatenatingNonStrings

public boolean requiresCastForConcatenatingNonStrings()

Does this dialect/database require casting of non-string arguments in the concat() function?

Returns:
true if casting using cast() is required

Since:
6.2

requiresFloatCastingOfIntegerDivision

public boolean requiresFloatCastingOfIntegerDivision()

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 46/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Does this dialect require that integer divisions be wrapped in cast() calls to tell the db parser the expected type.
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Returns:
ALL CLASSES SEARCH:
True if integer divisions must be cast()ed to float
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Implementation Note:
The culprit is HSQLDB.

supportsResultSetPositionQueryMethodsOnForwardOnlyCursor

public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()

Does this dialect support asking the result set its positioning information on forward-only cursors?

Specifically, in the case of scrolling fetches, Hibernate needs to use ResultSet.isAfterLast() and ResultSet.isBeforeFirst(). Certain drivers do not
allow access to these methods for forward-only cursors.

Returns:
True if methods like ResultSet.isAfterLast() and ResultSet.isBeforeFirst() are supported for forward only cursors; false otherwise.

Since:
3.2

API Note:
This is highly driver dependent!

supportsCircularCascadeDeleteConstraints

public boolean supportsCircularCascadeDeleteConstraints()

Does this dialect support definition of cascade delete constraints which can cause circular chains?

Returns:
True if circular cascade delete constraints are supported; false otherwise.

Since:
3.2

supportsSubselectAsInPredicateLHS

public boolean supportsSubselectAsInPredicateLHS()

Is a subselect supported as the left-hand side (LHS) of an IN predicates?

In other words, is syntax like <subquery> IN (1, 2, 3) supported?

Returns:
True if a subselect can appear as the LHS of an in-predicate; false otherwise.
Since:
3.2

supportsExpectedLobUsagePattern

public boolean supportsExpectedLobUsagePattern()

"Expected" LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy
casting to JDBC driver implementation-specific classes.

Returns:
True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.
Since:
3.2

Implementation Note:
Part of the trickiness here is the fact that this is largely driver-dependent. For example, Oracle (which is notoriously bad with LOB support in their drivers
historically) actually does a pretty good job with LOB support as of the 10.2.x v ersions of their driver.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 47/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

supportsLobValueChangePropagation
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
public boolean supportsLobValueChangePropagation()

Does the dialect support propagating changes to LOB values back to the database? Talking about mutating the internal value of the locator, as opposed
to supplying a new locator instance.
For BLOBs, the internal value might be changed by: Blob.setBinaryStream(long), Blob.setBytes(long, byte[]), Blob.setBytes(long, byte[],
int, int), or Blob.truncate(long).
For CLOBs, the internal value might be changed by: Clob.setAsciiStream(long), Clob.setCharacterStream(long), Clob.setString(long,
String), Clob.setString(long, String, int, int), or Clob.truncate(long).

Returns:
True if the changes are propagated back to the database; false otherwise.

Since:
3.2
Implementation Note:
I do not know the correct answer currently for databases which (1) are not part of the cruise control process, or (2) do not
supportsExpectedLobUsagePattern().

supportsUnboundedLobLocatorMaterialization

public boolean supportsUnboundedLobLocatorMaterialization()

Is it supported to materialize a LOB locator outside the transaction in which it was created?

Returns:
True if unbounded materialization is supported; false otherwise.
Since:
3.2

Implementation Note:
Again, part of the trickiness here is the fact that this is largely driver-dependent. All database I have tested which supportsExpectedLobUsagePattern()
also support the ability to materialize a LOB outside the owning transaction.

supportsSubqueryOnMutatingTable

public boolean supportsSubqueryOnMutatingTable()

Does this dialect support referencing the table being mutated in a subquery? The "table being mutated" is the table referenced in an update or delete
query. And so can that table then be referenced in a subquery of the update or delete query?

For example, would the following two syntaxes be supported:

delete from TABLE_A where ID not in (select ID from TABLE_A)


update TABLE_A set NON_ID = 'something' where ID in (select ID from TABLE_A)

Returns:
True if this dialect allows references the mutating table from a subquery.

supportsExistsInSelect

public boolean supportsExistsInSelect()

Does the dialect support an exists statement in the select clause?

Returns:
True if exists checks are allowed in the select clause; false otherwise.

doesReadCommittedCauseWritersToBlockReaders

public boolean doesReadCommittedCauseWritersToBlockReaders()

For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 48/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Returns:
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
True if writers block readers to achieve READ_COMMITTED; false otherwise.
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

doesRepeatableReadCauseReadersToBlockWriters

public boolean doesRepeatableReadCauseReadersToBlockWriters()

For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?

Returns:
True if readers block writers to achieve REPEATABLE_READ; false otherwise.

supportsBindAsCallableArgument

public boolean supportsBindAsCallableArgument()

Does this dialect support using a JDBC bind parameter as an argument to a function or procedure call?

Returns:
Returns true if the database supports accepting bind params as args, false otherwise. The default is true.

supportsTupleCounts

public boolean supportsTupleCounts()

Does this dialect support count(a,b)?

Returns:
True if the database supports counting tuples; false otherwise.

requiresParensForTupleCounts

public boolean requiresParensForTupleCounts()

If supportsTupleCounts() is true, does this dialect require the tuple to be delimited with parentheses?

Returns:
boolean

supportsTupleDistinctCounts

public boolean supportsTupleDistinctCounts()

Does this dialect support count(distinct a,b)?

Returns:
True if the database supports counting distinct tuples; false otherwise.

requiresParensForTupleDistinctCounts

public boolean requiresParensForTupleDistinctCounts()

If supportsTupleDistinctCounts() is true, does this dialect require the tuple to be delimited with parentheses?

Returns:
boolean

getInExpressionCountLimit

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 49/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
public int getInExpressionCountLimit()
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

Return the limit that the underlying database places on the number of elements in an IN predicate. If the database defines no such limits, simply return
ALL CLASSES SEARCH:
zero or a number smaller than zero.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Returns:
The limit, or a non-positive integer to indicate no limit.

getParameterCountLimit

public int getParameterCountLimit()

Return the limit that the underlying database places on the number of parameters that can be defined for a PreparedStatement. If the database defines
no such limits, simply return zero or a number smaller than zero. By default, Dialect returns the same value as getInExpressionCountLimit().

Returns:
The limit, or a non-positive integer to indicate no limit.

forceLobAsLastValue

public boolean forceLobAsLastValue()

Must LOB values occur last in inserts and updates?

Returns:
boolean True if Lob values should be last, false if it does not matter.
Implementation Note:
Oracle is the culprit here, see HHH-4635.

isEmptyStringTreatedAsNull

public boolean isEmptyStringTreatedAsNull()

Return whether the dialect considers an empty string value to be null.

Returns:
boolean True if an empty string is treated as null, false otherwise.
Implementation Note:
Once again, the culprit is Oracle.

useFollowOnLocking

public boolean useFollowOnLocking​(String sql, QueryOptions queryOptions)

Some dialects have trouble applying pessimistic locking depending upon what other query options are specified (paging, ordering, etc). This method
allows these dialects to request that locking be applied by subsequent selects.

Returns:
true indicates that the dialect requests that locking be applied by subsequent select; false (the default) indicates that locking should be applied to the
main SQL statement.
Since:
5.2

getUniqueDelegate

public UniqueDelegate getUniqueDelegate()

Get the UniqueDelegate supported by this dialect

Returns:
The UniqueDelegate

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 50/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

getQueryHintString
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
public String getQueryHintString​(String query, List<String> hintList)

Apply a hint to the given SQL query.

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

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

Parameters:
query - The query to which to apply the hint.

hintList - The hints to apply

Returns:
The modified SQL

getQueryHintString

public String getQueryHintString​(String query, String hints)

Apply a hint to the given SQL query.

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

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

Parameters:
query - The query to which to apply the hint.

hints - The hints to apply

Returns:
The modified SQL

defaultScrollMode

public ScrollMode defaultScrollMode()

A default ScrollMode to be used by Query.scroll().

Returns:
the default ScrollMode to use.

API Note:
Certain dialects support a subset of ScrollModes.

supportsOffsetInSubquery

public boolean supportsOffsetInSubquery()

Does this dialect support offset in subqueries?

For example:

select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1 offset 1)

Returns:
true if it does

supportsOrderByInSubquery

public boolean supportsOrderByInSubquery()

Does this dialect support the order by clause in subqueries?

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 51/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
For example:
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1)
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Returns:
true if it does

supportsSubqueryInSelect

public boolean supportsSubqueryInSelect()

Does this dialect support subqueries in the select clause?

For example:

select col1, (select col2 from Table2 where ...) from Table1

Returns:
true if it does

supportsInsertReturning

public boolean supportsInsertReturning()

Does this dialect fully support returning arbitrary generated column values after execution of an insert statement, using native SQL syntax?

Support for identity columns is insufficient here, we require something like:

1. insert ... returning ...


2. select from final table (insert ... )

Returns:
true if InsertReturningDelegate works for any sort of primary key column (not just identity columns), or false if InsertReturningDelegate does not
work, or only works for specialized identity/"autoincrement" columns
Since:
6.2

See Also:
OnExecutionGenerator.getGeneratedIdentifierDelegate(org.hibernate.id.PostInsertIdentityPersister), InsertReturningDelegate

supportsInsertReturningGeneratedKeys

public boolean supportsInsertReturningGeneratedKeys()

Does this dialect fully support returning arbitrary generated column values after execution of an insert statement, using the JDBC method
Connection.prepareStatement(String, String[]).

Support for returning the generated value of an identity column via the JDBC method Connection.prepareStatement(String, int) is insufficient here.

Returns:
true if GetGeneratedKeysDelegate works for any sort of primary key column (not just identity columns), or false if GetGeneratedKeysDelegate does not
work, or only works for specialized identity/"autoincrement" columns
Since:
6.2
See Also:
OnExecutionGenerator.getGeneratedIdentifierDelegate(org.hibernate.id.PostInsertIdentityPersister), GetGeneratedKeysDelegate

supportsFetchClause

public boolean supportsFetchClause​(FetchClauseType type)

Does this dialect support the given FETCH clause type.

Parameters:

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 52/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
type - The fetch clause type
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
Returns:
ALL CLASSES SEARCH:
true if the underlying database supports the given fetch clause type, false otherwise. The default is false.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

supportsWindowFunctions

public boolean supportsWindowFunctions()

Does this dialect support window functions like row_number() over (..)?

Returns:
true if the underlying database supports window functions, false otherwise. The default is false.

supportsLateral

public boolean supportsLateral()

Does this dialect support the SQL lateral keyword or a proprietary alternative?

Returns:
true if the underlying database supports lateral, false otherwise. The default is false.

getCallableStatementSupport

public CallableStatementSupport getCallableStatementSupport()

The CallableStatementSupport for this database. Does this database support returning cursors?

getNameQualifierSupport

public NameQualifierSupport getNameQualifierSupport()

The support for qualified identifiers.

By default, decide based on DatabaseMetaData.

Returns:
The NameQualifierSupport, or null to use DatabaseMetaData.

getMultiKeyLoadSizingStrategy

public MultiKeyLoadSizingStrategy getMultiKeyLoadSizingStrategy()

The strategy used to determine the appropriate number of keys to load in a single SQL query with multi-key loading.

See Also:
Session.byMultipleIds(java.lang.Class<T>), Session.byMultipleNaturalId(java.lang.Class<T>)

getBatchLoadSizingStrategy

public MultiKeyLoadSizingStrategy getBatchLoadSizingStrategy()

The strategy used to determine the appropriate number of keys to load in a single SQL query with batch-fetch loading.

See Also:
BatchSize

Implementation Note:
By default, the same as getMultiKeyLoadSizingStrategy()

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 53/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

isJdbcLogWarningsEnabledByDefault
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public boolean isJdbcLogWarningsEnabledByDefault() SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Is JDBC statement warning logging enabled by default?

Since:
5.1

augmentPhysicalTableTypes

public void augmentPhysicalTableTypes​(List<String> tableTypesList)

augmentRecognizedTableTypes

public void augmentRecognizedTableTypes​(List<String> tableTypesList)

supportsPartitionBy

public boolean supportsPartitionBy()

Does is dialect support partition by?

Since:
5.2

supportsNamedParameters

public boolean supportsNamedParameters​(DatabaseMetaData databaseMetaData) throws SQLException

Override DatabaseMetaData.supportsNamedParameters().

Throws:
SQLException - Accessing the DatabaseMetaData cause an exception. Just rethrow and Hibernate will handle it.

getNationalizationSupport

public NationalizationSupport getNationalizationSupport()

Determines whether this database requires the use of explicitly nationalized character (Unicode) data types.

That is, whether the use of Types.NCHAR, Types.NVARCHAR, and Types.NCLOB is required for nationalized character data.

getAggregateSupport

public AggregateSupport getAggregateSupport()

How does this dialect support aggregate types like SqlTypes.STRUCT.

Since:
6.2

supportsStandardArrays

public boolean supportsStandardArrays()

Does this database have native support for ANSI SQL standard arrays which are expressed in terms of the element type name: integer array.

Returns:

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 54/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
boolean
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
Since:
ALL CLASSES SEARCH:
6.1
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Implementation Note:
Oracle doesn't have this; we must instead use named array types.

useArrayForMultiValuedParameters

public boolean useArrayForMultiValuedParameters()

Does this database prefer to use array types for multi-valued parameters.

Returns:
boolean
Since:
6.3

getArrayTypeName

public String getArrayTypeName​(String javaElementTypeName, String elementTypeName, Integer maxLength)

The SQL type name for the array type with elements of the given type name.

The ANSI-standard syntax is integer array.

Since:
6.1

appendArrayLiteral

public void appendArrayLiteral​(SqlAppender appender, Object[] literal, JdbcLiteralFormatter<Object> elementFormatter,


WrapperOptions wrapperOptions)

Append an array literal with the given elements to the given SqlAppender.

supportsDistinctFromPredicate

public boolean supportsDistinctFromPredicate()

Does this dialect support some kind of distinct from predicate?

That is, does it support syntax like:

... where FIRST_NAME IS DISTINCT FROM LAST_NAME

Returns:
True if this SQL dialect is known to support some kind of distinct from predicate; false otherwise

Since:
6.1

getPreferredSqlTypeCodeForArray

public int getPreferredSqlTypeCodeForArray()

The JDBC type code to use for mapping properties of basic Java array or Collection types.

Usually SqlTypes.ARRAY or SqlTypes.VARBINARY.

Returns:
one of the type codes defined by SqlTypes.

Since:

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 55/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
6.1
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES SEARCH:


SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
getPreferredSqlTypeCodeForBoolean

public int getPreferredSqlTypeCodeForBoolean()

The JDBC type code to use for mapping properties of Java type boolean.

Usually Types.BOOLEAN or Types.BIT.

Returns:
one of the type codes defined by Types.

supportsNonQueryWithCTE

public boolean supportsNonQueryWithCTE()

Does this dialect support insert, update, and delete statements with Common Table Expressions (CTEs)?

Returns:
true if non-query statements are supported with CTE

supportsRecursiveCTE

public boolean supportsRecursiveCTE()

Does this dialect/database support recursive CTEs?

Returns:
true if recursive CTEs are supported

Since:
6.2

supportsValuesList

public boolean supportsValuesList()

Does this dialect support values lists of form VALUES (1), (2), (3)?

Returns:
true if values list are supported

supportsValuesListForInsert

public boolean supportsValuesListForInsert()

Does this dialect support values lists of form VALUES (1), (2), (3) in insert statements?

Returns:
true if values list are allowed in insert statements

supportsSkipLocked

public boolean supportsSkipLocked()

Does this dialect support SKIP_LOCKED timeout.

Returns:
true if SKIP_LOCKED is supported

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 56/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

supportsNoWait
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public boolean supportsNoWait() SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Does this dialect support NO_WAIT timeout.

Returns:
true if NO_WAIT is supported

supportsWait

public boolean supportsWait()

Does this dialect support WAIT timeout.

Returns:
true if WAIT is supported

inlineLiteral

@Deprecated(since="6", forRemoval=true) public String inlineLiteral​


(String literal)

Deprecated, for removal: This API element is subject to removal in a future version.
This is no longer called

appendLiteral

public void appendLiteral​(SqlAppender appender, String literal)

Append a literal string to the given SqlAppender.

API Note:
Needed because MySQL has nonstandard escape characters

appendBinaryLiteral

public void appendBinaryLiteral​(SqlAppender appender, byte[] bytes)

Append a binary literal to the given SqlAppender.

supportsJdbcConnectionLobCreation

public boolean supportsJdbcConnectionLobCreation​(DatabaseMetaData databaseMetaData)

Check whether the JDBC Connection supports creating LOBs via Connection.createBlob(), Connection.createNClob(), or Connection.createClob().

Parameters:
databaseMetaData - JDBC DatabaseMetaData which can be used if LOB creation is supported only starting from a given driver version

Returns:
true if LOBs can be created via the JDBC Connection.

supportsMaterializedLobAccess

public boolean supportsMaterializedLobAccess()

Check whether the JDBC driver allows setting LOBs via PreparedStatement.setBytes(int, byte[]), PreparedStatement.setNString(int, String),
or PreparedStatement.setString(int, String) APIs.

Returns:
true if LOBs can be set with the materialized APIs.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 57/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Since:
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
6.2
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

useMaterializedLobWhenCapacityExceeded

public boolean useMaterializedLobWhenCapacityExceeded()

Whether to switch:
from VARCHAR-like types to SqlTypes.MATERIALIZED_CLOB types when the requested size for a type exceeds the getMaxVarcharCapacity(),
from NVARCHAR-like types to SqlTypes.MATERIALIZED_NCLOB types when the requested size for a type exceeds the getMaxNVarcharCapacity(), and
from VARBINARY-like types to SqlTypes.MATERIALIZED_BLOB types when the requested size for a type exceeds the getMaxVarbinaryCapacity().

Returns:
true if materialized LOBs should be used for capacity exceeding types.

Since:
6.2

addSqlHintOrComment

public String addSqlHintOrComment​(String sql, QueryOptions queryOptions, boolean commentsEnabled)

Modify the SQL, adding hints or comments, if necessary

prependComment

protected String prependComment​(String sql, String comment)

Prepend a comment to the given SQL fragment.

escapeComment

public static String escapeComment​(String comment)

Perform necessary character escaping on the text of the comment.

getHqlTranslator

public HqlTranslator getHqlTranslator()

Return an HqlTranslator specific to this dialect, or null to use the standard translator.

Note that QueryEngineOptions.getCustomHqlTranslator() has higher precedence since it comes directly from the user config.

See Also:
StandardHqlTranslator, QueryEngine.getHqlTranslator()

getSqmTranslatorFactory

public SqmTranslatorFactory getSqmTranslatorFactory()

Return a SqmTranslatorFactory specific to this dialect, or null to use the standard translator.

Note that QueryEngineOptions.getCustomSqmTranslatorFactory() has higher precedence since it comes directly from the user config.

See Also:
StandardSqmTranslator, QueryEngine.getSqmTranslatorFactory()

getSqlAstTranslatorFactory

public SqlAstTranslatorFactory getSqlAstTranslatorFactory()

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 58/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Return a SqlAstTranslatorFactory specific to this dialect, or null to use the standard translator.
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

See Also:
ALL CLASSES SEARCH:
StandardSqlAstTranslatorFactory, JdbcEnvironment.getSqlAstTranslatorFactory()
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

getGroupBySelectItemReferenceStrategy

public SelectItemReferenceStrategy getGroupBySelectItemReferenceStrategy()

Determine how selected items are referenced in the group by clause.

getSizeStrategy

public Dialect.SizeStrategy getSizeStrategy()

A custom Dialect.SizeStrategy for column types.

getMaxVarcharLength

public int getMaxVarcharLength()

The biggest size value that can be supplied as argument to a Types.VARCHAR-like type.

For longer column lengths, use some sort of text-like type for the column.

getMaxNVarcharLength

public int getMaxNVarcharLength()

The biggest size value that can be supplied as argument to a Types.NVARCHAR-like type.

For longer column lengths, use some sort of ntext-like type for the column.

getMaxVarbinaryLength

public int getMaxVarbinaryLength()

The biggest size value that can be supplied as argument to a Types.VARBINARY-like type.

For longer column lengths, use some sort of image-like type for the column.

getMaxVarcharCapacity

public int getMaxVarcharCapacity()

The longest possible length of a Types.VARCHAR-like column.

For longer column lengths, use some sort of clob-like type for the column.

getMaxNVarcharCapacity

public int getMaxNVarcharCapacity()

The longest possible length of a Types.NVARCHAR-like column.

For longer column lengths, use some sort of nclob-like type for the column.

getMaxVarbinaryCapacity

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 59/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
public int getMaxVarbinaryCapacity()
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

The longest possible length of a Types.VARBINARY-like column.


ALL CLASSES SEARCH:
SUMMARY: NESTED
For longer | FIELD |lengths,
column CONSTR use
| METHOD
some sortDETAIL: FIELD | type
of blob-like CONSTR
for|the
METHOD
column.

getDefaultLobLength

public long getDefaultLobLength()

The default length for a LOB column, if LOB columns have a length in this dialect.

Returns:
1048576L by default
See Also:
Length.LOB_DEFAULT

getDefaultDecimalPrecision

public int getDefaultDecimalPrecision()

This is the default precision for a generated column mapped to a BigInteger or BigDecimal.

Usually returns the maximum precision of the database, except when there is no such maximum precision, or the maximum precision is very high.

Returns:
the default precision, in decimal digits

getDefaultTimestampPrecision

public int getDefaultTimestampPrecision()

This is the default precision for a generated column mapped to a Timestamp or LocalDateTime.

Usually 6 (microseconds) or 3 (milliseconds).

Returns:
the default precision, in decimal digits, of the fractional seconds field

getFloatPrecision

public int getFloatPrecision()

This is the default precision for a generated column mapped to a Java Float or float. That is, a value representing "single precision".

Usually 24 binary digits, at least for databases with a conventional interpretation of the ANSI SQL specification.

Returns:
a value representing "single precision", usually in binary digits, but sometimes in decimal digits

getDoublePrecision

public int getDoublePrecision()

This is the default precision for a generated column mapped to a Java Double or double. That is, a value representing "double precision".

Usually 53 binary digits, at least for databases with a conventional interpretation of the ANSI SQL specification.

Returns:
a value representing "double precision", usually in binary digits, but sometimes in decimal digits

getFractionalSecondPrecisionInNanos

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 60/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
public long getFractionalSecondPrecisionInNanos()
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

The "native" precision for arithmetic with datetimes and day-to-second durations. Datetime differences will be calculated with this precision except
ALL CLASSES SEARCH:
when a precision is explicitly specified as a TemporalUnit.
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Usually 1 (nanoseconds), 1_000 (microseconds), or 1_000_000 (milliseconds).

Returns:
the precision, specified as a quantity of nanoseconds
See Also:
TemporalUnit.NATIVE

Implementation Note:
Getting this right is very important. It would be great if all platforms supported datetime arithmetic with nanosecond precision, since that is how we
represent Duration. But they don't, and we don't want to fill up the SQL expression with many conversions to/from nanoseconds. (Not to mention the
problems with numeric overflow that this sometimes causes.) So we need to pick the right value here, and implement
timestampaddPattern(org.hibernate.query.sqm.TemporalUnit, jakarta.persistence.TemporalType, org.hibernate.query.sqm.IntervalType) and
timestampdiffPattern(org.hibernate.query.sqm.TemporalUnit, jakarta.persistence.TemporalType, jakarta.persistence.TemporalType)
consistent with our choice.

supportsBitType

public boolean supportsBitType()

Does this dialect have a true SQL BIT type with just two values (0 and 1) or, even better, a proper SQL BOOLEAN type, or does Types.BIT get mapped to a
numeric type with more than two values?

Returns:
true if there is a BIT or BOOLEAN type

supportsPredicateAsExpression

protected boolean supportsPredicateAsExpression()

Whether a predicate like a > 0 can appear in an expression context, for example, in a select list item.

getLockRowIdentifier

public RowLockStrategy getLockRowIdentifier​(LockMode lockMode)

Obtain a RowLockStrategy for the given LockMode.

generatedAs

public String generatedAs​(String generatedAs)

The generated as clause, or similar, for generated column declarations in DDL statements.

Parameters:
generatedAs - a SQL expression used to generate the column value

Returns:
The generated as clause containing the given expression

hasDataTypeBeforeGeneratedAs

public boolean hasDataTypeBeforeGeneratedAs()

Is an explicit column type required for generated as columns?

Returns:
true if an explicit type is required

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 61/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

createOptionalTableUpdateOperation
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public MutationOperation createOptionalTableUpdateOperation​
(EntityMutationTarget mutationTarget, SEARCH:
OptionalTableUpdate
SUMMARY: optionalTableUpdate,
NESTED | FIELD | CONSTR | METHOD SessionFactoryImplementor
DETAIL: FIELD | CONSTR | METHOD factory)

Create a MutationOperation for a updating an optional table

canDisableConstraints

public boolean canDisableConstraints()

Is there some way to disable foreign key constraint checking while truncating tables? (If there's no way to do it, and if we can't batch truncate, we must
drop and recreate the constraints instead.)

Returns:
true if there is some way to do it

See Also:
getDisableConstraintsStatement(), getDisableConstraintStatement(String, String)

getDisableConstraintsStatement

public String getDisableConstraintsStatement()

A SQL statement that temporarily disables foreign key constraint checking for all tables.

getEnableConstraintsStatement

public String getEnableConstraintsStatement()

A SQL statement that re-enables foreign key constraint checking for all tables.

getDisableConstraintStatement

public String getDisableConstraintStatement​(String tableName, String name)

A SQL statement that temporarily disables checking of the given foreign key constraint.

Parameters:
tableName - the name of the table

name - the name of the constraint

getEnableConstraintStatement

public String getEnableConstraintStatement​(String tableName, String name)

A SQL statement that re-enables checking of the given foreign key constraint.

Parameters:
tableName - the name of the table

name - the name of the constraint

canBatchTruncate

public boolean canBatchTruncate()

Does the truncate table statement accept multiple tables?

Returns:
true if it does

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 62/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

getTruncateTableStatements
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public String[] getTruncateTableStatements​(String[] tableNames) SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
A SQL statement or statements that truncate the given tables.

Parameters:
tableNames - the names of the tables

getTruncateTableStatement

public String getTruncateTableStatement​(String tableName)

A SQL statement that truncates the given table.

Parameters:
tableName - the name of the table

getNativeParameterMarkerStrategy

public ParameterMarkerStrategy getNativeParameterMarkerStrategy()

Support for native parameter markers.

This is generally dependent on both the database and the driver.

Returns:
May return null to indicate that the JDBC standard strategy should be used

supportsBatchUpdates

public Boolean supportsBatchUpdates()

Whether this Dialect supports batch updates.

Returns:
true indicates it does; false indicates it does not; null indicates it might and that database-metadata should be consulted.

See Also:
ExtractedDatabaseMetaData.supportsBatchUpdates()

supportsRefCursors

public Boolean supportsRefCursors()

Whether this Dialect supports the JDBC Types.REF_CURSOR type.

Returns:
true indicates it does; false indicates it does not; null indicates it might and that database-metadata should be consulted

See Also:
ExtractedDatabaseMetaData.supportsRefCursors()

appendDatetimeFormat

public void appendDatetimeFormat​(SqlAppender appender, String format)

Translate the given datetime format string from the pattern language defined by Java's DateTimeFormatter to whatever pattern language is understood
by the native datetime formatting function for this database (often the to_char() function).

Since it's never possible to translate every pattern letter sequences understood by DateTimeFormatter, only the following subset of pattern letters is
accepted by Hibernate:

G: era
y: year of era

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 63/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)
Y: year of week-based year
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP
M: month of year
ALL CLASSES w: week of week-based year (ISO week number) SEARCH:
W: week of month
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
E: day of week (name)
e: day of week (number)
d: day of month
D: day of year
a: AM/PM
H: hour of day (24 hour time)
h: hour of AM/PM (12 hour time)
m: minutes
s: seconds
z,Z,x: timezone offset

In addition, punctuation characters and single-quoted literal strings are accepted.

Appends a pattern accepted by the function that formats dates and times in this dialect to a SQL fragment that is being constructed.

translateExtractField

public String translateExtractField​(TemporalUnit unit)

Return the name used to identify the given field as an argument to the extract() function, or of this dialect's equivalent function.

This method does not need to handle TemporalUnit.NANOSECOND, TemporalUnit.NATIVE, TemporalUnit.OFFSET, TemporalUnit.DATE, TemporalUnit.TIME,
TemporalUnit.WEEK_OF_YEAR, nor TemporalUnit.WEEK_OF_MONTH, which are already desugared by ExtractFunction.

translateDurationField

public String translateDurationField​(TemporalUnit unit)

Return the name used to identify the given unit of duration as an argument to #timestampadd() or #timestampdiff(), or of this dialect's equivalent
functions.

This method does not need to handle TemporalUnit.NANOSECOND, TemporalUnit.NATIVE, TemporalUnit.OFFSET, TemporalUnit.DAY_OF_WEEK,
TemporalUnit.DAY_OF_MONTH, TemporalUnit.DAY_OF_YEAR, TemporalUnit.DATE, TemporalUnit.TIME, TemporalUnit.TIMEZONE_HOUR,
TemporalUnit.TIMEZONE_MINUTE, TemporalUnit.WEEK_OF_YEAR, nor TemporalUnit.WEEK_OF_MONTH, which are not units of duration.

appendDateTimeLiteral

public void appendDateTimeLiteral​(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision,


TimeZone jdbcTimeZone)

Append a datetime literal representing the given java.time value to the given SqlAppender.

appendDateTimeLiteral

public void appendDateTimeLiteral​(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone)

Append a datetime literal representing the given Date value to the given SqlAppender.

appendDateTimeLiteral

public void appendDateTimeLiteral​(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone)

Append a datetime literal representing the given Calendar value to the given SqlAppender.

appendIntervalLiteral

public void appendIntervalLiteral​(SqlAppender appender, Duration literal)

Append a literal SQL interval representing the given Java Duration.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 64/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

appendUUIDLiteral
ALL CLASSES SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
public void appendUUIDLiteral​(SqlAppender appender, UUID literal)

Append a literal SQL uuid representing the given Java UUID.

This is usually a cast() expression, but it might be a function call.

supportsTemporalLiteralOffset

public boolean supportsTemporalLiteralOffset()

Does this dialect supports timezone offsets in temporal literals.

getTimeZoneSupport

public TimeZoneSupport getTimeZoneSupport()

How the dialect supports time zone types like Types.TIMESTAMP_WITH_TIMEZONE.

rowId

public String rowId​(String rowId)

The name of a rowid-like pseudo-column which acts as a high-performance row locator, or null if this dialect has no such pseudo-column.

If the rowid-like value is an explicitly-declared named column instead of an implicit pseudo-column, and if the given name is nonempty, return the given
name.

Parameters:
rowId - the name specified by RowId.value(), which is ignored if getRowIdColumnString(java.lang.String) is not overridden

rowIdSqlType

public int rowIdSqlType()

The JDBC type code of the rowid-like pseudo-column which acts as a high-performance row locator.

Returns:
Types.ROWID by default

getRowIdColumnString

public String getRowIdColumnString​(String rowId)

If this dialect requires that the rowid column be declared explicitly, return the DDL column definition.

Returns:
the DDL column definition, or null if the rowid is an implicit pseudo-column

getDmlTargetColumnQualifierSupport

public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport()

Get the minimum DmlTargetColumnQualifierSupport required by this dialect.

Returns:
the column qualifier support required by this dialect

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 65/66


09/01/2025, 00:19 Dialect (Hibernate Javadocs)

getFunctionalDependencyAnalysisSupport
OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES
public FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport() SEARCH:
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Get this dialect's level of support for primary key functional dependency analysis within GROUP BY and ORDER BY clauses.

getDefaultIntervalSecondScale

public int getDefaultIntervalSecondScale()

Resolves the default scale for a SqlTypes.INTERVAL_SECOND type code for the given column

Usually 9 (nanosecond) or 6 (microseconds).

Returns:
the default scale, in decimal digits, of the fractional seconds field

OVERVIEW PACKAGE CLASS USE TREE DEPRECATED INDEX HELP

ALL CLASSES

SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


Copyright © 2001-2024 Red Hat, Inc. All Rights Reserved.

https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/dialect/Dialect.html#:~:text=Since Hibernate 6%2C a single,by the getVersion() property. 66/66

You might also like