Top Description Fields Constructors Methods
org.hibernate.dialect

public abstract Class Dialect

extends Object
implements ConversionContext
Class Inheritance
All Implemented Interfaces
org.hibernate.exception.spi.ConversionContext
Known Direct Subclasses
org.hibernate.dialect.FrontBaseDialect, org.hibernate.dialect.H2Dialect, org.hibernate.dialect.HSQLDialect, org.hibernate.dialect.InformixDialect, org.hibernate.dialect.InterbaseDialect, org.hibernate.dialect.JDataStoreDialect, org.hibernate.dialect.MckoiDialect, org.hibernate.dialect.MimerSQLDialect, org.hibernate.dialect.MySQLDialect, org.hibernate.dialect.Oracle8iDialect, org.hibernate.dialect.Oracle9Dialect, org.hibernate.dialect.PointbaseDialect, org.hibernate.dialect.IngresDialect, org.hibernate.dialect.PostgreSQL81Dialect, org.hibernate.dialect.ProgressDialect, org.hibernate.dialect.RDMSOS2200Dialect, org.hibernate.dialect.SAPDBDialect, org.hibernate.dialect.TeradataDialect, org.hibernate.dialect.TimesTenDialect, org.hibernate.dialect.AbstractHANADialect, org.hibernate.dialect.AbstractTransactSQLDialect, org.hibernate.dialect.Cache71Dialect, org.hibernate.dialect.CockroachDB192Dialect, org.hibernate.dialect.CUBRIDDialect, org.hibernate.dialect.DB2Dialect
Annotations
@SuppressWarnings:deprecation
Imports
java.io.InputStream, .OutputStream, java.sql.Blob, .CallableStatement, .Clob, .Connection, .DatabaseMetaData, .NClob, .PreparedStatement, .ResultSet, .SQLException, .Types, java.util.HashMap, .HashSet, .Iterator, .List, .Locale, .Map, .Properties, .Set, java.util.regex.Matcher, .Pattern, org.hibernate.Criteria, .HibernateException, .Interceptor, .LockMode, .LockOptions, .MappingException, .NullPrecedence, .Query, .ScrollMode, org.hibernate.boot.model.TypeContributions, org.hibernate.boot.model.relational.AuxiliaryDatabaseObject, .Sequence, org.hibernate.cfg.AvailableSettings, .Environment, org.hibernate.dialect.function.CastFunction, .SQLFunction, .SQLFunctionTemplate, .StandardAnsiSqlAggregationFunctions, .StandardSQLFunction, org.hibernate.dialect.identity.IdentityColumnSupport, .IdentityColumnSupportImpl, org.hibernate.dialect.lock.LockingStrategy, .OptimisticForceIncrementLockingStrategy, .OptimisticLockingStrategy, .PessimisticForceIncrementLockingStrategy, .PessimisticReadSelectLockingStrategy, .PessimisticWriteSelectLockingStrategy, .SelectLockingStrategy, org.hibernate.dialect.pagination.LegacyLimitHandler, .LimitHandler, org.hibernate.dialect.unique.DefaultUniqueDelegate, .UniqueDelegate, org.hibernate.engine.config.spi.ConfigurationService, .StandardConverters, org.hibernate.engine.jdbc.LobCreator, org.hibernate.engine.jdbc.env.internal.DefaultSchemaNameResolver, org.hibernate.engine.jdbc.env.spi.AnsiSqlKeywords, .IdentifierHelper, .IdentifierHelperBuilder, .NameQualifierSupport, .SchemaNameResolver, org.hibernate.engine.jdbc.spi.JdbcServices, org.hibernate.engine.spi.QueryParameters, .SharedSessionContractImplementor, org.hibernate.exception.spi.ConversionContext, .SQLExceptionConversionDelegate, .SQLExceptionConverter, .ViolatedConstraintNameExtracter, org.hibernate.hql.spi.id.MultiTableBulkIdStrategy, org.hibernate.hql.spi.id.persistent.PersistentTableBulkIdStrategy, org.hibernate.id.IdentifierGenerator, .IdentityGenerator, org.hibernate.id.enhanced.SequenceStyleGenerator, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.internal.util.ReflectHelper, .StringHelper, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.internal.util.io.StreamCopier, org.hibernate.loader.BatchLoadSizingStrategy, org.hibernate.mapping.Column, .Constraint, .ForeignKey, .Index, .Table, org.hibernate.persister.entity.Lockable, org.hibernate.procedure.internal.StandardCallableStatementSupport, org.hibernate.procedure.spi.CallableStatementSupport, org.hibernate.service.ServiceRegistry, org.hibernate.sql.ANSICaseFragment, .ANSIJoinFragment, .CaseFragment, .ForUpdateFragment, .JoinFragment, org.hibernate.tool.hbm2ddl.SchemaUpdate, org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorLegacyImpl, .SequenceInformationExtractorNoOpImpl, org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor, org.hibernate.tool.schema.internal.StandardAuxiliaryDatabaseObjectExporter, .StandardForeignKeyExporter, .StandardIndexExporter, .StandardSequenceExporter, .StandardTableExporter, .StandardUniqueKeyExporter, org.hibernate.tool.schema.spi.Exporter, org.hibernate.type.StandardBasicTypes, .Type, org.hibernate.type.descriptor.sql.ClobTypeDescriptor, .SqlTypeDescriptor

Represents a dialect of SQL implemented by a particular RDBMS. Subclasses implement Hibernate compatibility with different systems. Subclasses should provide a public default constructor that register a set of type mappings and default Hibernate properties. Subclasses should be immutable.
Author
Gavin King, David Channon

Field Summary

Modifier and TypeField and Description
private StandardAuxiliaryDatabaseObjectExporter
public static final String
CLOSED_QUOTE

Characters used as closing for quoting SQL identifiers

public static final String
DEFAULT_BATCH_SIZE

Defines a default batch size constant

private static final Pattern
private static final Pattern
private static final ViolatedConstraintNameExtracter
private StandardForeignKeyExporter
private final TypeNames
private StandardIndexExporter
protected static final LobMergeStrategy
LEGACY_LOB_MERGE_STRATEGY

The legacy behavior of Hibernate.

private boolean
private static final CoreMessageLogger
protected static final LobMergeStrategy
NEW_LOCATOR_LOB_MERGE_STRATEGY

Merge strategy based on creating a new LOB locator.

public static final String
NO_BATCH

Defines a "no batching" batch size constant

private final Properties
public static final String
QUOTE

Characters used as opening for quoting SQL identifiers

private StandardSequenceExporter
private static final Pattern
private final Map<String, SQLFunction>
private final Set<String>
protected final BatchLoadSizingStrategy
protected static final LobMergeStrategy
STREAM_XFER_LOB_MERGE_STRATEGY

Merge strategy based on transferring contents based on streams.

private StandardTableExporter
public static final String
private final TypeNames
private final UniqueDelegate
private StandardUniqueKeyExporter

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public String
addSqlHintOrComment(String
original sql
sql
,
QueryParameters
query parameters
parameters
,
boolean
if comments are enabled
commentsEnabled
)

Modify the SQL, adding hints or comments, if necessary

public String

Returns:

The table with any required lock hints.
appendLockHint
(LockMode
The lock mode to apply
mode
,
String
The name of the table to which to apply the lock hint.
tableName
)

Deprecated use appendLockHint(LockOptions,String) instead
Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause.
public String

Returns:

The table with any required lock hints.
appendLockHint
(LockOptions
The lock options to apply
lockOptions
,
String
The name of the table to which to apply the lock hint.
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.

public String

Returns:

the modified SQL string.
applyLocksToSql
(String
the SQL string to modify
sql
,
LockOptions
lock options indexed by aliased table names.
aliasedLockOptions
,
Map<String, String[]>
a map of key columns indexed by aliased table names.
keyColumnNames
)

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

public boolean

Returns:

True if comparisons are case insensitive.
areStringComparisonsCaseInsensitive
()

Are string comparisons implicitly case insensitive.

public void
public void
public boolean

Returns:

true if limit parameters should come before other parameters
bindLimitParametersFirst
()

Deprecated getLimitHandler() should be overridden instead.
Does the LIMIT clause come at the start of the SELECT statement, rather than at the end?
public boolean

Returns:

true if the correct order is limit, offset
bindLimitParametersInReverseOrder
()

Deprecated getLimitHandler() should be overridden instead.
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.
public IdentifierHelper

Returns:

The IdentifierHelper instance to use, or null to indicate Hibernate should use its fallback path
buildIdentifierHelper
(IdentifierHelperBuilder
A semi-configured IdentifierHelper builder.
builder
,
DatabaseMetaData
Access to the metadata returned from the driver if needed and if available.

Warning

may be null

dbMetaData
)

Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.

public SQLExceptionConversionDelegate

Returns:

The SQLExceptionConversionDelegate for this dialect
buildSQLExceptionConversionDelegate
()

Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.

public SQLExceptionConverter

Returns:

The Dialect's preferred SQLExceptionConverter, or null to indicate that the default SQLExceptionConverter should be used.
buildSQLExceptionConverter
()

Deprecated buildSQLExceptionConversionDelegate() should be overridden instead.
Build an instance of the SQLExceptionConverter preferred by this dialect for converting SQLExceptions into Hibernate's JDBCException hierarchy.
public boolean

Returns:

True if the dialect supports catalog creation; false otherwise.
canCreateCatalog
()

Does this dialect support catalog creation?

public boolean

Returns:

True if the dialect supports schema creation; false otherwise.
canCreateSchema
()

Does this dialect support schema creation?

public String

Returns:

The cast expression
cast
(String
The value to cast
value
,
int
The JDBC type code to cast to
jdbcTypeCode
,
int
The type length
length
,
int
The type precision
precision
,
int
The type scale
scale
)

Return an expression casting the value to the specified type

public String

Returns:

The cast expression
cast
(String
The value to cast
value
,
int
The JDBC type code to cast to
jdbcTypeCode
,
int
The type length
length
)

Return an expression casting the value to the specified type.

public String

Returns:

The cast expression
cast
(String
The value to cast
value
,
int
The JDBC type code to cast to
jdbcTypeCode
,
int
The type precision
precision
,
int
The type scale
scale
)

Return an expression casting the value to the specified type.

public char

Returns:

The dialect's specific close quote character.
closeQuote
()

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

public void
contributeTypes(TypeContributions
Callback to contribute the types
typeContributions
,
ServiceRegistry
The service registry
serviceRegistry
)

Allows the Dialect to contribute additional types

public int

Returns:

The corresponding db/dialect specific offset.
convertToFirstRowValue
(int
The user-supplied, zero-based first row offset.
zeroBasedFirstResult
)

Deprecated getLimitHandler() should be overridden instead.
Hibernate APIs explicitly state that setFirstResult() should be a zero-based offset.
public CaseFragment

Returns:

This dialect's CaseFragment strategy.
createCaseFragment
()

Create a CaseFragment strategy responsible for handling this dialect's variations in how CASE statements are handled.

public JoinFragment

Returns:

This dialect's JoinFragment strategy.
createOuterJoinFragment
()

Create a JoinFragment strategy responsible for handling this dialect's variations in how joins are handled.

public ScrollMode

Returns:

ScrollMode
defaultScrollMode
()

Certain dialects support a subset of ScrollModes.

public boolean

Returns:

True if writers block readers to achieve READ_COMMITTED; false otherwise.
doesReadCommittedCauseWritersToBlockReaders
()

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

public boolean

Returns:

True if readers block writers to achieve REPEATABLE_READ; false otherwise.
doesRepeatableReadCauseReadersToBlockWriters
()

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

public boolean

Returns:

True if constraints must be dropped prior to dropping the table; false otherwise.
dropConstraints
()

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

public boolean

Returns:

true if the two type codes are equivalent
equivalentTypes
(int
the first JDBC type code
typeCode1
,
int
the second JDBC type code
typeCode2
)

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

public static String
protected String

Returns:

escaped String
escapeLiteral
(String literal)

Escape String literal.

public boolean

Returns:

True to force limit into SQL query even if none specified in Hibernate query; false otherwise.
forceLimitUsage
()

Deprecated getLimitHandler() should be overridden instead.
Generally, if there is no limit applied to a Hibernate query we do not apply any limits to the SQL query.
public boolean

Returns:

boolean True if Lob values should be last, false if it does not matter.
forceLobAsLastValue
()

HHH-4635 Oracle expects all Lob values to be last in inserts and updates.

public boolean

Returns:

True if the database supports FOR UPDATE OF syntax; false otherwise.
forUpdateOfColumns
()

Is FOR UPDATE OF syntax supported?

public String

Returns:

The "add column" fragment.
getAddColumnString
()

The syntax used to add a column to a table (optional).

public String

Returns:

The suffix "add column" fragment.
getAddColumnSuffixString
()

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

public String

Returns:

the "add FK" fragment
getAddForeignKeyConstraintString
(String
The FK constraint name.
constraintName
,
String[]
The names of the columns comprising the FK
foreignKey
,
String
The table referenced by the FK
referencedTable
,
String[]
The explicit columns in the referencedTable referenced by this FK.
primaryKey
,
boolean
if false, constraint should be explicit about which column names the constraint refers to
referencesPrimaryKey
)

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

public String
getAddForeignKeyConstraintString(String constraintName, String foreignKeyDefinition)

public String

Returns:

The "add PK" fragment
getAddPrimaryKeyConstraintString
(String
The name of the PK constraint.
constraintName
)

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

public String

Returns:

The "add unique" fragment
getAddUniqueConstraintString
(String
The name of the unique constraint.
constraintName
)

Deprecated getUniqueDelegate() should be overridden instead.
The syntax used to add a unique constraint to a table.
public String

Returns:

The command used to alter a table.
getAlterTableString
(String
The name of the table to alter
tableName
)

Command used to alter a table.

public Exporter<AuxiliaryDatabaseObject>
public CallableStatementSupport
public String

Returns:

String
getCascadeConstraintsString
()

Completely optional cascading drop clause

public String

Returns:

The dialect-specific "case insensitive" like function.
getCaseInsensitiveLike
()

The name of the SQL function that can do case insensitive like comparison.

public String

Returns:

The database type name
getCastTypeName
(int
The Types typecode
code
)

Get the name of the database type appropriate for casting operations (via the CAST() SQL function) for the given Types typecode.

public ColumnAliasExtractor
public String

Returns:

The comment fragment
getColumnComment
(String
The comment to apply
comment
)

Get the comment into a form supported for column definition.

public String[]

Returns:

The creation commands
getCreateCatalogCommand
(String
The name of the catalog to be created.
catalogName
)

Get the SQL command used to create the named catalog

public String

Returns:

The command used to create a multiset table.
getCreateMultisetTableString
()

Slight variation on getCreateTableString.

public String[]

Returns:

The creation commands
getCreateSchemaCommand
(String
The name of the schema to be created.
schemaName
)

Get the SQL command used to create the named schema

protected String

Returns:

The sequence creation command
getCreateSequenceString
(String
The name of the sequence
sequenceName
)

Typically dialects which support sequences can create a sequence with a single command.

protected String

Returns:

The sequence creation command
getCreateSequenceString
(String
The name of the sequence
sequenceName
,
int
The initial value to apply to 'create sequence' statement
initialValue
,
int
The increment value to apply to 'create sequence' statement
incrementSize
)

Overloaded form of getCreateSequenceString(String), additionally taking the initial value and increment size to be applied to the sequence definition.

public String[]

Returns:

The sequence creation commands
getCreateSequenceStrings
(String
The name of the sequence
sequenceName
)

The multiline script used to create a sequence.
public String[]

Returns:

The sequence creation commands
getCreateSequenceStrings
(String
The name of the sequence
sequenceName
,
int
The initial value to apply to 'create sequence' statement
initialValue
,
int
The increment value to apply to 'create sequence' statement
incrementSize
)

An optional multi-line form for databases which supportsPooledSequences().

public String

Returns:

The command used to create a table.
getCreateTableString
()

Command used to create a table.

public String

Returns:

The annotation to be appended (e.g. "COLLATE DATABASE_DEFAULT" in SQLServer SQL)
getCreateTemporaryTableColumnAnnotation
(int
The SQL type code
sqlTypeCode
)

Annotation to be appended to the end of each COLUMN clause for temporary tables.

public String

Returns:

The cross join separator
getCrossJoinSeparator
()

Returns the separator to use for defining cross joins when translating HQL queries.

public String

Returns:

The current schema retrieval SQL
getCurrentSchemaCommand
()

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

public String

Returns:

The command.
getCurrentTimestampSelectString
()

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

public String

Returns:

The function name.
getCurrentTimestampSQLFunctionName
()

The name of the database-specific SQL function for retrieving the current timestamp.

public BatchLoadSizingStrategy
public MultiTableBulkIdStrategy
public final Properties

Returns:

a set of Hibernate properties
getDefaultProperties
()

Retrieve a set of default Hibernate properties for this database.

public static Dialect

Returns:

The specified Dialect
getDialect
()

Deprecated this static method will be removed.
Get an instance of the dialect specified by the current System properties.
public static Dialect

Returns:

The specified Dialect
getDialect
(Properties
The properties to use for finding the dialect class to use.
props
)

Deprecated this static method will be removed.
Get an instance of the dialect specified by the given properties or by the current System properties.
public String[]

Returns:

The drop commands
getDropCatalogCommand
(String
The name of the catalog to be dropped.
catalogName
)

Get the SQL command used to drop the named catalog

public String
public String[]

Returns:

The drop commands
getDropSchemaCommand
(String
The name of the schema to be dropped.
schemaName
)

Get the SQL command used to drop the named schema

protected String

Returns:

The sequence drop commands
getDropSequenceString
(String
The name of the sequence
sequenceName
)

Typically dialects which support sequences can drop a sequence with a single command.

public String[]

Returns:

The sequence drop commands
getDropSequenceStrings
(String
The name of the sequence
sequenceName
)

The multiline script used to drop a sequence.

public String

Returns:

The DROP TABLE command
getDropTableString
(String
The name of the table to drop
tableName
)

Generate a DROP TABLE statement

public Exporter<ForeignKey>
public String

Returns:

The appropriate FOR UPDATE NOWAIT clause string.
getForUpdateNowaitString
()

Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.

public String

Returns:

The appropriate FOR UPDATE OF colunm_list NOWAIT clause string.
getForUpdateNowaitString
(String
The columns to be write locked.
aliases
)

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

public String

Returns:

The appropriate FOR UPDATE SKIP LOCKED clause string.
getForUpdateSkipLockedString
()

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

public String

Returns:

The appropriate FOR UPDATE colunm_list SKIP LOCKED clause string.
getForUpdateSkipLockedString
(String
The columns to be write locked.
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.

public String

Returns:

The appropriate for update fragment.
getForUpdateString
(LockOptions
contains the lock mode to apply.
lockOptions
)

Given LockOptions (lockMode, timeout), determine the appropriate for update fragment to use.

private String
getForUpdateString(LockMode lockMode, int timeout)

public String

Returns:

The appropriate for update fragment.
getForUpdateString
(LockMode
The lock mode to apply.
lockMode
)

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

public String

Returns:

The appropriate FOR UPDATE clause string.
getForUpdateString
()

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

public String

Returns:

The appropriate FOR UPDATE OF column_list clause string.
getForUpdateString
(String
The columns to be write locked.
aliases
)

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

public String

Returns:

The appropriate FOR UPDATE OF column_list clause string.
getForUpdateString
(String
The columns to be write locked.
aliases
,
LockOptions
the lock options to apply
lockOptions
)

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

public final Map<String, SQLFunction>

Returns:

The map of registered functions.
getFunctions
()

Retrieves a map of the dialect's registered functions (functionName => SQLFunction).

public String

Returns:

The Hibernate Type name.
getHibernateTypeName
(int
The Types type code
code
)

Get the name of the Hibernate Type associated with the given Types type code.

public String

Returns:

The Hibernate Type name.
getHibernateTypeName
(int
The Types typecode
code
,
int
The datatype length
length
,
int
The datatype precision
precision
,
int
The datatype scale
scale
)

Get the name of the Hibernate Type associated with the given Types typecode with the given storage specification parameters.

public IdentityColumnSupport

Returns:

the IdentityColumnSupport
getIdentityColumnSupport
()

Get the appropriate IdentityColumnSupport

public Exporter<Index>
public int

Returns:

int The limit, or zero-or-less to indicate no limit.
getInExpressionCountLimit
()

Return the limit that the underlying database places on the number of elements in an IN predicate.

public Set<String>
getKeywords()

Deprecated These are only ever used (if at all) from the code that handles identifier quoting.
public LimitHandler

Returns:

LIMIT clause delegate.
getLimitHandler
()

Returns the delegate managing LIMIT clause.

public String

Returns:

The modified query statement with the limit applied.
getLimitString
(String
The query to which to apply the limit.
query
,
int
The offset of the limit
offset
,
int
The limit of the limit ;)
limit
)

Deprecated getLimitHandler() should be overridden instead.
Given a limit and an offset, apply the limit clause to the query.
protected String

Returns:

the modified SQL
getLimitString
(String
The query to which to apply the limit.
query
,
boolean
Is the query requesting an offset?
hasOffset
)

Deprecated getLimitHandler() should be overridden instead.
Apply a limit clause to the query.
public LobMergeStrategy
public LockingStrategy

Returns:

The appropriate locking strategy.
getLockingStrategy
(Lockable
The persister for the entity to be locked.
lockable
,
LockMode
The type of lock to be acquired.
lockMode
)

Get a strategy instance which knows how to acquire a database-level lock of the specified mode for this dialect.

public String

Returns:

The dialect-specific lowercase function.
getLowercaseFunction
()

The name of the SQL function that transforms a string to lowercase

public int

Returns:

The maximum length.
getMaxAliasLength
()

What is the maximum length Hibernate can use for generated aliases?

public NameQualifierSupport

Returns:

The NameQualifierSupport.
getNameQualifierSupport
()

By default interpret this based on DatabaseMetaData.

public Class<T>

Returns:

The native generator class.
getNativeIdentifierGeneratorClass
()

The class (which implements IdentifierGenerator) which acts as this dialects native generation strategy.
public String

Returns:

The native generator strategy.
getNativeIdentifierGeneratorStrategy
()

Resolves the native generation strategy associated to this dialect.

public String

Returns:

The appropriate empty values clause.
getNoColumnsInsertString
()

The fragment used to insert a row without specifying any column values.

public String

Returns:

The negated expression
getNotExpression
(String
The expression to negate
expression
)

Negate an expression

public String

Returns:

String
getNullColumnString
()

The keyword used to specify a nullable column.

public String

Returns:

The modified SQL
getQueryHintString
(String
The query to which to apply the hint.
query
,
List<String>
The hints to apply
hintList
)

Apply a hint to the query.

public String

Returns:

The modified SQL
getQueryHintString
(String
The query to which to apply the hint.
query
,
String
The hints to apply
hints
)

Apply a hint to the query.

public String

Returns:

The select command; or null if sequences are not supported.
getQuerySequencesString
()

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

public String

Returns:

The appropriate LOCK clause string.
getReadLockString
(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

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

public String

Returns:

The appropriate LOCK clause string.
getReadLockString
(String
The columns to be read locked.
aliases
,
int
in milliseconds, -1 for indefinite wait and 0 for no wait.
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.

public ResultSet

Returns:

The extracted result set.
getResultSet
(CallableStatement
The callable statement.
statement
)

Given a callable statement previously processed by registerResultSetOutParameter, extract the ResultSet from the OUT parameter.

public ResultSet

Returns:

The extracted result set.
getResultSet
(CallableStatement
The callable statement.
statement
,
int
The bind position at which to register the output param.
position
)

Given a callable statement previously processed by registerResultSetOutParameter, extract the ResultSet.

public ResultSet

Returns:

The extracted result set.
getResultSet
(CallableStatement
The callable statement.
statement
,
String
The parameter name (for drivers which support named parameters).
name
)

Given a callable statement previously processed by registerResultSetOutParameter, extract the ResultSet from the OUT parameter.

public SchemaNameResolver

Returns:

The schema name resolver strategy
getSchemaNameResolver
()

Get the strategy for determining the schema name of a Connection

public String

Returns:

The appropriate select clause value fragment.
getSelectClauseNullString
(int
The Types type code.
sqlType
)

Given a Types type code, determine an appropriate null value to use in a select clause.

public String

Returns:

The appropriate command.
getSelectGUIDString
()

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

public String

Returns:

The "nextval" fragment.
getSelectSequenceNextValString
(String
the name of the sequence
sequenceName
)

Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.

public Exporter<Sequence>
public SequenceInformationExtractor
public String

Returns:

String The "nextval" select string.
getSequenceNextValString
(String
the name of the sequence
sequenceName
)

Generate the appropriate select statement to to retrieve the next value of a sequence.

protected SqlTypeDescriptor

Returns:

The SqlTypeDescriptor to use as an override, or null if there is no override.
getSqlTypeDescriptorOverride
(int
A Types constant indicating the SQL column type
sqlCode
)

Returns the SqlTypeDescriptor that should be used to handle the given JDBC type code.

public String

Returns:

The comment fragment
getTableComment
(String
The comment to apply
comment
)

Get the comment into a form supported for table definition.

public Exporter<Table>
public String
public String

Returns:

the database type name
getTypeName
(int
The Types typecode
code
)

Get the name of the database type associated with the given Types typecode.

public String

Returns:

the database type name
getTypeName
(int
The Types typecode
code
,
long
The datatype length
length
,
int
The datatype precision
precision
,
int
The datatype scale
scale
)

Get the name of the database type associated with the given Types typecode with the given storage specification parameters.

public UniqueDelegate

Returns:

The UniqueDelegate
getUniqueDelegate
()

Get the UniqueDelegate supported by this dialect

public Exporter<Constraint>
public ViolatedConstraintNameExtracter
public String

Returns:

The appropriate LOCK clause string.
getWriteLockString
(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

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

public String

Returns:

The appropriate LOCK clause string.
getWriteLockString
(String
The columns to be read locked.
aliases
,
int
in milliseconds, -1 for indefinite wait and 0 for no wait.
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.

public boolean

Returns:

True if we support altering of tables; false otherwise.
hasAlterTable
()

Does this dialect support the ALTER TABLE syntax?

public boolean

Returns:

true if the database/driver has this bug
hasSelfReferentialForeignKeyBug
()

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

public String

Returns:

escaped String
inlineLiteral
(String literal)

Inline String literal.

private static Dialect
instantiateDialect(String dialectName)

Deprecated such static helpers will be removed
public boolean

Returns:

True if the getCurrentTimestampSelectString return is callable; false otherwise.
isCurrentTimestampSelectStringCallable
()

Should the value returned by getCurrentTimestampSelectString be treated as callable.

private static boolean
isFloatOrRealOrDouble(int typeCode)

public boolean

Returns:

boolean
isJdbcLogWarningsEnabledByDefault
()

Does the fetching JDBC statement warning for logging is enabled by default

public boolean
public boolean

Returns:

True if the lock timeout is rendered into the SQL string as a parameter; false otherwise.
isLockTimeoutParameterized
()

If this dialect supports specifying lock timeouts, are those timeouts rendered into the SQL string as parameters.

private static boolean
isNumericOrDecimal(int typeCode)

public boolean

Returns:

true if the given string has been registered either as a hibernate type or as a custom-registered one
isTypeNameRegistered
(final String
the type name.
typeName
)

Whether or not the given type name has been registered for this dialect (including both hibernate type names and custom-registered type names).

public char

Returns:

The dialect's specific open quote character.
openQuote
()

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

protected String
public boolean

Returns:

boolean
qualifyIndexName
()

Do we need to qualify index names with the schema name?

public final String

Returns:

The quoted (or unmodified, if not starting with back-tick) value.
quote
(String
The value to be quoted.
name
)

Apply dialect-specific quoting.

protected void
registerColumnType(int
The Types typecode
code
,
long
The maximum length of database type
capacity
,
String
The database type name
name
)

Subclasses register a type name for the given type code and maximum column length.

protected void
registerColumnType(int
The Types typecode
code
,
String
The database type name
name
)

Subclasses register a type name for the given type code.

protected void
protected void
registerHibernateType(int
The Types typecode
code
,
long
The maximum length of database type
capacity
,
String
The Hibernate Type name
name
)

Registers a Hibernate Type name for the given Types type code and maximum column length.

protected void
registerHibernateType(int
The Types typecode
code
,
String
The Hibernate Type name
name
)

Registers a Hibernate Type name for the given Types type code.

protected void
public int

Returns:

The number of (contiguous) bind positions used.
registerResultSetOutParameter
(CallableStatement
The callable statement.
statement
,
int
The bind position at which to register the output param.
position
)

Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returning ResultSet *by position*.

public int

Returns:

The number of (contiguous) bind positions used.
registerResultSetOutParameter
(CallableStatement
The callable statement.
statement
,
String
The parameter name (for drivers which support named parameters).
name
)

Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returning ResultSet *by name*.

public SqlTypeDescriptor

Returns:

The SqlTypeDescriptor that should be used for this dialect; if there is no override, then original sqlTypeDescriptor is returned.
remapSqlTypeDescriptor
(SqlTypeDescriptor
The SqlTypeDescriptor to override
sqlTypeDescriptor
)

Allows the dialect to override a SqlTypeDescriptor.

public String

Returns:

Renders single element of ORDER BY clause.
renderOrderByElement
(String
The SQL order expression. In case of @OrderBy annotation user receives property placeholder (e.g. attribute name enclosed in '{' and '}' signs).
expression
,
String
Collation string in format collate IDENTIFIER, or null if expression has not been explicitly specified.
collation
,
String
Order direction. Possible values: asc, desc, or null if expression has not been explicitly specified.
order
,
NullPrecedence
Nulls precedence. Default value: NullPrecedence#NONE.
nulls
)

Renders an ordering fragment

public boolean

Returns:

true if result variable references in the ORDER BY clause should be replaced by column positions; false otherwise.
replaceResultVariableInOrderByClauseWithPosition
()

Does this dialect require that references to result variables (i.e, select expression aliases) in an ORDER BY clause be replaced by column positions (1-origin) as defined by the select clause?

public boolean

Returns:

True if select clause parameter must be cast()ed
requiresCastingOfParametersInSelectClause
()

Does this dialect require that parameters appearing in the SELECT clause be wrapped in cast() calls to tell the db parser the expected type.

public boolean

Returns:

boolean
requiresParensForTupleDistinctCounts
()

If supportsTupleDistinctCounts() is true, does the Dialect require the tuple to be wrapped with parens?

private void
public boolean

Returns:

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

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

public boolean

Returns:

true indicates that the dialect does support cascaded delete on foreign keys.
supportsCascadeDelete
()

Does this dialect support cascaded delete on foreign key definitions?

public boolean

Returns:

true if the underlying database supports case insensitive like comparison, false otherwise. The default is false.
supportsCaseInsensitiveLike
()

Does this dialect support case insensitive LIKE restrictions?

public boolean

Returns:

True if circular cascade delete constraints are supported; false otherwise.
supportsCircularCascadeDeleteConstraints
()

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

public boolean

Returns:

True if column-level CHECK constraints are supported; false otherwise.
supportsColumnCheck
()

Does this dialect support column-level check constraints?

public boolean

Returns:

true if commenting is supported
supportsCommentOn
()

Does this dialect/database support commenting on tables, columns, etc?

public boolean

Returns:

True if the current timestamp can be retrieved; false otherwise.
supportsCurrentTimestampSelection
()

Does this dialect support a way to retrieve the database's current timestamp value?

public boolean

Returns:

True if empty in lists are supported; false otherwise.
supportsEmptyInList
()

Does this dialect support empty IN lists?

public boolean

Returns:

True if exists checks are allowed in the select clause; false otherwise.
supportsExistsInSelect
()

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

public boolean

Returns:

True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.
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...

public boolean

Returns:

true if the "if exists" can be applied after ALTER TABLE
supportsIfExistsAfterAlterTable
()

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

public boolean

Returns:

true if the "if exists" can be applied after the constraint name
supportsIfExistsAfterConstraintName
()

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

public boolean

Returns:

true if the "if exists" can be applied after the table name
supportsIfExistsAfterTableName
()

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

public boolean

Returns:

true if the "if exists" can be applied before the constraint name
supportsIfExistsBeforeConstraintName
()

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

public boolean

Returns:

true if the "if exists" can be applied before the table name
supportsIfExistsBeforeTableName
()

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

public boolean

Returns:

true if LOBs can be created via the JDBC Connection.
supportsJdbcConnectionLobCreation
(DatabaseMetaData
JDBC DatabaseMetaData which can be used if LOB creation is supported only starting from a given Driver version
databaseMetaData
)

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

public boolean

Returns:

True if this dialect supports some form of LIMIT.
supportsLimit
()

Deprecated getLimitHandler() should be overridden instead.
Does this dialect support some form of limiting query results via a SQL clause?
public boolean

Returns:

True if the dialect supports an offset within the limit support.
supportsLimitOffset
()

Deprecated getLimitHandler() should be overridden instead.
Does this dialect's LIMIT support (if any) additionally support specifying an offset?
public boolean

Returns:

True if the changes are propagated back to the database; false otherwise.
supportsLobValueChangePropogation
()

Does the dialect support propagating changes to LOB values back to the database?

public boolean

Returns:

True is this dialect supports specifying lock timeouts.
supportsLockTimeouts
()

Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.

public boolean

Returns:

boolean
supportsNamedParameters
(DatabaseMetaData databaseMetaData)

Override the DatabaseMetaData#supportsNamedParameters()

public boolean

Returns:

boolean
supportsNationalizedTypes
()

Does this dialect supports Nationalized Types

public boolean

Returns:

if the Dialect supports no-column INSERT.
supportsNoColumnsInsert
()

Check if the INSERT statement is allowed to contain no column.

public boolean

Returns:

true if non-query statements are supported with CTE
supportsNonQueryWithCTE
()

Does this dialect/database support non-query statements (e.g. INSERT, UPDATE, DELETE) with CTE (Common Table Expressions)?

public boolean

Returns:

deprecated
supportsNotNullUnique
()

Deprecated getUniqueDelegate() should be overridden instead.
Is the combination of not-null and unique supported?
public boolean

Returns:

true if NO_WAIT is supported
supportsNoWait
()

Does this dialect/database support NO_WAIT timeout.

public boolean

Returns:

True if outer joined rows can be locked via FOR UPDATE.
supportsOuterJoinForUpdate
()

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

public boolean

Returns:

True if this is supported; false otherwise.
supportsParametersInInsertSelect
()

Does this dialect support parameters within the SELECT clause of INSERT ...

public boolean

Returns:

boolean
supportsPartitionBy
()

Does the underlying database support partition by

public boolean

Returns:

True if such "pooled" sequences are supported; false otherwise.
supportsPooledSequences
()

Does this dialect support "pooled" sequences.

public boolean

Returns:

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

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

public boolean

Returns:

True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
supportsRowValueConstructorSyntax
()

Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.

public boolean

Returns:

True if this SQL dialect is known to support "row value constructor" syntax in the IN list; false otherwise.
supportsRowValueConstructorSyntaxInInList
()

If the dialect supports row values, does it offer such support in IN lists as well?

public boolean

Returns:

True if this SQL dialect is known to support "row value constructor" syntax in the SET clause; false otherwise.
supportsRowValueConstructorSyntaxInSet
()

Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax, sometimes called tuple syntax, in the SET clause;

Basically, does it support syntax like "...

public boolean
public boolean

Returns:

True if sequences supported; false otherwise.
supportsSequences
()

Does this dialect support sequences?

public boolean

Returns:

true if SKIP_LOCKED is supported
supportsSkipLocked
()

Does this dialect/database support SKIP_LOCKED timeout.

public boolean

Returns:

True if this dialect allows references the mutating table from a subquery.
supportsSubqueryOnMutatingTable
()

Does this dialect support referencing the table being mutated in a subquery.

public boolean

Returns:

True if subselects can appear as the LHS of an in-predicate; false otherwise.
supportsSubselectAsInPredicateLHS
()

Are subselects supported as the left-hand-side (LHS) of IN-predicates.

public boolean

Returns:

True if table-level CHECK constraints are supported; false otherwise.
supportsTableCheck
()

Does this dialect support table-level check constraints?

public boolean

Returns:

True if the database supports counting tuples; false otherwise.
supportsTupleCounts
()

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

public boolean

Returns:

True if the database supports counting distinct tuples; false otherwise.
supportsTupleDistinctCounts
()

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

public boolean

Returns:

boolean
supportsTuplesInSubqueries
()

Does this dialect support tuples in subqueries?

public boolean

Returns:

True if unbounded materialization is supported; false otherwise.
supportsUnboundedLobLocatorMaterialization
()

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

public boolean

Returns:

True if UNION ALL is supported; false otherwise.
supportsUnionAll
()

Does this dialect support UNION ALL, which is generally a faster variant of UNION?

public boolean

Returns:

boolean
supportsUnique
()

Deprecated getUniqueDelegate() should be overridden instead.
Does this dialect support the UNIQUE column syntax?
public boolean

Returns:

boolean
supportsUniqueConstraintInCreateAlterTable
()

Deprecated getUniqueDelegate() should be overridden instead.
Does this dialect support adding Unique constraints via create and alter table ?
public boolean

Returns:

true if VALUES list are supported
supportsValuesList
()

Does this dialect/database support VALUES list (e.g. VALUES (1), (2), (3) )

public boolean

Returns:

True if bind variables can be used; false otherwise.
supportsVariableLimit
()

Deprecated getLimitHandler() should be overridden instead.
Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?
public String

Returns:

The appropriate SQL literal.
toBooleanValueString
(boolean
The boolean value
bool
)

The SQL literal value to which this database maps boolean values.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String

Returns:

The mutated select command, or the same as was passed in.
transformSelectString
(String
The select command
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.

public boolean

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..
useFollowOnLocking
()

Deprecated Use useFollowOnLocking(QueryParameters) instead.
Some dialects have trouble applying pessimistic locking depending upon what other query options are specified (paging, ordering, etc).
public boolean

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..
useFollowOnLocking
(QueryParameters
query parameters
parameters
)

Some dialects have trouble applying pessimistic locking depending upon what other query options are specified (paging, ordering, etc).

public boolean

Returns:

True if BLOBs and CLOBs should be bound using stream operations.
useInputStreamToInsertBlob
()

Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e. PreparedStatement#setBinaryStream).

public boolean

Returns:

True if limit is relative from offset; false otherwise.
useMaxForLimit
()

Deprecated getLimitHandler() should be overridden instead.
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait