public abstract class Dialect extends Object implements ConversionContext
DialectResolutionInfo.
Subclasses should be immutable.| Modifier and Type | Class and Description |
|---|---|
static interface |
Dialect.SizeStrategy
Pluggable strategy for determining the Size to use for columns of
a given SQL type.
|
class |
Dialect.SizeStrategyImpl |
| Modifier and Type | Field and Description |
|---|---|
static String |
CLOSED_QUOTE
Characters used as closing for quoting SQL identifiers
|
static String |
DEFAULT_BATCH_SIZE
Defines a default batch size constant
|
protected static LobMergeStrategy |
LEGACY_LOB_MERGE_STRATEGY
The legacy behavior of Hibernate.
|
protected static LobMergeStrategy |
NEW_LOCATOR_LOB_MERGE_STRATEGY
Merge strategy based on creating a new LOB locator.
|
protected static String |
NO_BATCH
Defines a "no batching" batch size constant
|
static String |
QUOTE
Characters used as opening for quoting SQL identifiers
|
protected BatchLoadSizingStrategy |
STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY |
protected static LobMergeStrategy |
STREAM_XFER_LOB_MERGE_STRATEGY
Merge strategy based on transferring contents based on streams.
|
static String |
TWO_SINGLE_QUOTES_REPLACEMENT |
| Modifier | Constructor and Description |
|---|---|
protected |
Dialect() |
| Modifier and Type | Method and Description |
|---|---|
String |
addSqlHintOrComment(String sql,
QueryOptions queryOptions,
boolean commentsEnabled)
Modify the SQL, adding hints or comments, if necessary
|
String |
appendLockHint(LockMode mode,
String tableName)
Deprecated.
use
appendLockHint(LockOptions,String) instead |
String |
appendLockHint(LockOptions lockOptions,
String tableName)
Deprecated.
This was moved to
AbstractSqlAstTranslator |
String |
applyLocksToSql(String sql,
LockOptions aliasedLockOptions,
Map<String,String[]> keyColumnNames)
Modifies the given SQL by applying the appropriate updates for the specified
lock modes and key columns.
|
boolean |
areStringComparisonsCaseInsensitive()
Are string comparisons implicitly case insensitive.
|
void |
augmentRecognizedTableTypes(List<String> tableTypesList) |
protected static Size |
binaryToDecimalPrecision(int code,
Size size)
Useful conversion for databases which represent the
precision of a float(p) using p expressed in decimal
digits instead of the usual (standard) binary digits.
|
boolean |
bindLimitParametersFirst()
Deprecated.
getLimitHandler() should be overridden instead. |
boolean |
bindLimitParametersInReverseOrder()
Deprecated.
getLimitHandler() should be overridden instead. |
IdentifierHelper |
buildIdentifierHelper(IdentifierHelperBuilder builder,
DatabaseMetaData dbMetaData)
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
|
SQLExceptionConversionDelegate |
buildSQLExceptionConversionDelegate()
Build an instance of a
SQLExceptionConversionDelegate for
interpreting dialect-specific error or SQLState codes. |
SQLExceptionConverter |
buildSQLExceptionConverter()
Deprecated.
buildSQLExceptionConversionDelegate() should be
overridden instead. |
boolean |
canCreateCatalog()
Does this dialect support catalog creation?
|
boolean |
canCreateSchema()
Does this dialect support schema creation?
|
String |
castPattern(CastType from,
CastType to)
Obtain a pattern for the SQL equivalent to a
cast() function call. |
char |
closeQuote()
The character specific to this dialect used to close a quoted identifier.
|
void |
contributeTypes(TypeContributions typeContributions,
ServiceRegistry serviceRegistry)
Allows the Dialect to contribute additional types
|
int |
convertToFirstRowValue(int zeroBasedFirstResult)
Deprecated.
getLimitHandler() should be overridden instead. |
CaseFragment |
createCaseFragment()
Deprecated.
migrating away from deprecated
CaseFragment |
JoinFragment |
createOuterJoinFragment()
Deprecated.
migrating away from deprecated
JoinFragment |
String |
currentDate()
Translation of the HQL/JPQL
current_date function, which
maps to the Java type java.sql.Date, and of the HQL
local_date function which maps to the Java type
java.sql.LocalDate. |
String |
currentLocalTime()
Translation of the HQL
local_time function, which maps to
the Java type java.time.LocalTime which is a time with no
time zone. |
String |
currentLocalTimestamp()
Translation of the HQL
local_datetime function, which maps
to the Java type java.time.LocalDateTime which is a datetime
with no time zone. |
String |
currentTime()
Translation of the HQL/JPQL
current_time function, which
maps to the Java type java.sql.Time which is a time with
no time zone. |
String |
currentTimestamp()
Translation of the HQL/JPQL
current_timestamp function,
which maps to the Java type java.sql.Timestamp which is
a datetime with no time zone. |
String |
currentTimestampWithTimeZone()
Translation of the HQL
offset_datetime function, which maps
to the Java type java.time.OffsetDateTime which is a datetime
with a time zone. |
ScrollMode |
defaultScrollMode()
Certain dialects support a subset of ScrollModes.
|
boolean |
doesReadCommittedCauseWritersToBlockReaders()
For the underlying database, is READ_COMMITTED isolation implemented by
forcing readers to wait for write locks to be released?
|
boolean |
doesRepeatableReadCauseReadersToBlockWriters()
For the underlying database, is REPEATABLE_READ isolation implemented by
forcing writers to wait for read locks to be released?
|
boolean |
dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?
|
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. |
static String |
escapeComment(String comment) |
protected String |
escapeLiteral(String literal)
Escape String literal.
|
String |
extractPattern(TemporalUnit unit)
Obtain a pattern for the SQL equivalent to an
extract() function call. |
boolean |
forceLimitUsage()
Deprecated.
getLimitHandler() should be overridden instead. |
boolean |
forceLobAsLastValue()
HHH-4635
Oracle expects all Lob values to be last in inserts and updates.
|
protected String |
formatAsTimestamp(Calendar calendar,
TimeZone jdbcTimeZone) |
protected String |
formatAsTimestamp(Date date,
TimeZone jdbcTimeZone) |
protected String |
formatAsTimestamp(TemporalAccessor temporalAccessor,
TimeZone jdbcTimeZone) |
String |
formatBinaryLiteral(byte[] bytes) |
String |
formatDateTimeLiteral(Calendar calendar,
TemporalType precision,
TimeZone jdbcTimeZone) |
String |
formatDateTimeLiteral(Date date,
TemporalType precision,
TimeZone jdbcTimeZone) |
String |
formatDateTimeLiteral(TemporalAccessor temporalAccessor,
TemporalType precision,
TimeZone jdbcTimeZone) |
boolean |
forUpdateOfColumns()
Deprecated.
Use
getWriteRowLockStrategy() instead |
String |
getAddColumnString()
The syntax used to add a column to a table (optional).
|
String |
getAddColumnSuffixString()
The syntax for the suffix used to add a column to a table (optional).
|
String |
getAddForeignKeyConstraintString(String constraintName,
String foreignKeyDefinition) |
String |
getAddForeignKeyConstraintString(String constraintName,
String[] foreignKey,
String referencedTable,
String[] primaryKey,
boolean referencesPrimaryKey)
The syntax used to add a foreign key constraint to a table.
|
String |
getAddPrimaryKeyConstraintString(String constraintName)
The syntax used to add a primary key constraint to a table.
|
String |
getAddUniqueConstraintString(String constraintName)
Deprecated.
getUniqueDelegate() should be overridden instead. |
String |
getAlterTableString(String tableName)
Command used to alter a table.
|
Exporter<AuxiliaryDatabaseObject> |
getAuxiliaryDatabaseObjectExporter() |
String |
getBooleanCheckCondition(String columnName,
int sqlType,
char falseChar,
char trueChar)
Render a SQL check condition for a column that represents a boolean value.
|
CallableStatementSupport |
getCallableStatementSupport() |
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. |
String |
getCaseInsensitiveLike()
The name of the SQL function that can do case insensitive like comparison.
|
String |
getCastTypeName(SqlExpressable type,
Long length,
Integer precision,
Integer scale)
Get the name of the database type appropriate for casting operations
(via the CAST() SQL function) for the given
SqlExpressable
SQL type. |
ColumnAliasExtractor |
getColumnAliasExtractor() |
String |
getColumnComment(String comment)
Get the comment into a form supported for column definition.
|
String[] |
getCreateCatalogCommand(String catalogName)
Get the SQL command used to create the named catalog
|
String |
getCreateMultisetTableString()
Slight variation on
getCreateTableString(). |
String[] |
getCreateSchemaCommand(String schemaName)
Get the SQL command used to create the named schema
|
protected String |
getCreateSequenceString(String sequenceName)
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
protected String |
getCreateSequenceString(String sequenceName,
int initialValue,
int incrementSize)
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
String[] |
getCreateSequenceStrings(String sequenceName,
int initialValue,
int incrementSize)
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
String |
getCreateTableString()
Command used to create a table.
|
String |
getCreateTemporaryTableColumnAnnotation(int sqlTypeCode)
Annotation to be appended to the end of each COLUMN clause for temporary tables.
|
String |
getCrossJoinSeparator()
The separator to use for declaring cross joins in a SQL query,
typically either
" cross join " or a comma ", ",
where the spaces are required. |
String |
getCurrentSchemaCommand()
Get the SQL command used to retrieve the current schema name.
|
String |
getCurrentTimestampSelectString()
Deprecated.
no longer called, use
currentTimestamp() |
String |
getCurrentTimestampSQLFunctionName()
Deprecated.
|
BatchLoadSizingStrategy |
getDefaultBatchLoadSizingStrategy() |
int |
getDefaultDecimalPrecision()
This is the default precision for a generated
column mapped to a
BigInteger
or BigDecimal. |
long |
getDefaultLobLength() |
Properties |
getDefaultProperties()
Retrieve a set of default Hibernate properties for this database.
|
int |
getDefaultTimestampPrecision()
This is the default precision for a generated
column mapped to a
Timestamp or
LocalDateTime. |
static Dialect |
getDialect()
Deprecated.
this just calls the default constructor and does not pass in the
DialectResolutionInfo. |
static Dialect |
getDialect(Properties props)
Deprecated.
this just calls the default constructor and does not pass in the
DialectResolutionInfo. |
int |
getDoublePrecision()
This is the default precision for a generated
column mapped to a Java
Double or
double. |
String[] |
getDropCatalogCommand(String catalogName)
Get the SQL command used to drop the named catalog
|
String |
getDropForeignKeyString() |
String[] |
getDropSchemaCommand(String schemaName)
Get the SQL command used to drop the named schema
|
protected String |
getDropSequenceString(String sequenceName)
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
String[] |
getDropSequenceStrings(String sequenceName)
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
String |
getDropTableString(String tableName)
Generate a DROP TABLE statement
|
String |
getEnumCheckCondition(String columnName,
int sqlType,
Class<? extends Enum<?>> enumClass)
Render a SQL check condition for a column that represents an enumerated value.
|
SqmMultiTableMutationStrategy |
getFallbackSqmMutationStrategy(EntityMappingType entityDescriptor,
RuntimeModelCreationContext runtimeModelCreationContext) |
int |
getFloatPrecision()
This is the default precision for a generated
column mapped to a Java
Float or
float. |
Exporter<ForeignKey> |
getForeignKeyExporter() |
String |
getForUpdateNowaitString()
Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.
|
String |
getForUpdateNowaitString(String aliases)
Get the FOR UPDATE OF column_list NOWAIT fragment appropriate
for this dialect given the aliases of the columns to be write locked.
|
String |
getForUpdateSkipLockedString()
Retrieves the FOR UPDATE SKIP LOCKED syntax specific to this dialect.
|
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.
|
String |
getForUpdateString()
Get the string to append to SELECT statements to acquire locks
for this dialect.
|
String |
getForUpdateString(LockMode lockMode)
Given a lock mode, determine the appropriate for update fragment to use.
|
String |
getForUpdateString(LockOptions lockOptions)
Given LockOptions (lockMode, timeout), determine the appropriate for update fragment to use.
|
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.
|
String |
getForUpdateString(String aliases,
LockOptions lockOptions)
Get the FOR UPDATE OF column_list fragment appropriate for this
dialect given the aliases of the columns to be write locked.
|
long |
getFractionalSecondPrecisionInNanos()
The "native" precision for arithmetic with datetimes
and day-to-second durations.
|
String |
getFromDual()
Deprecated.
Moved to
AbstractSqlAstTranslator |
GroupByConstantRenderingStrategy |
getGroupByConstantRenderingStrategy()
Deprecated.
Moved to
AbstractSqlAstTranslator |
GroupBySummarizationRenderingStrategy |
getGroupBySummarizationRenderingStrategy()
Deprecated.
Moved to
AbstractSqlAstTranslator |
String |
getHibernateTypeName(int code)
|
String |
getHibernateTypeName(int code,
Integer length,
Integer precision,
Integer scale)
|
HqlTranslator |
getHqlTranslator()
Return an HqlTranslator specific for the Dialect.
|
IdentityColumnSupport |
getIdentityColumnSupport()
Get the appropriate
IdentityColumnSupport |
Exporter<Index> |
getIndexExporter() |
int |
getInExpressionCountLimit()
Return the limit that the underlying database places on the number of elements in an
IN predicate. |
Set<String> |
getKeywords()
Deprecated.
These are only ever used (if at all) from the code that handles identifier quoting.
So see
buildIdentifierHelper(org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder, java.sql.DatabaseMetaData) instead |
LimitHandler |
getLimitHandler()
Returns a
LimitHandler that implements support for
Query.setMaxResults(int) and
Query.setFirstResult(int) for
this dialect. |
protected String |
getLimitString(String query,
boolean hasOffset)
Deprecated.
getLimitHandler() should be overridden instead. |
String |
getLimitString(String query,
int offset,
int limit)
Deprecated.
getLimitHandler() should be overridden instead. |
LobMergeStrategy |
getLobMergeStrategy() |
LockingStrategy |
getLockingStrategy(Lockable lockable,
LockMode lockMode)
Get a strategy instance which knows how to acquire a database-level lock
of the specified mode for this dialect.
|
RowLockStrategy |
getLockRowIdentifier(LockMode lockMode) |
String |
getLowercaseFunction()
The name of the SQL function that transforms a string to
lowercase
|
int |
getMaxAliasLength()
What is the maximum length Hibernate can use for generated aliases?
The maximum here should account for the fact that Hibernate often needs to append "uniqueing" information
to the end of generated aliases.
|
NameQualifierSupport |
getNameQualifierSupport()
By default interpret this based on DatabaseMetaData.
|
NationalizationSupport |
getNationalizationSupport() |
Class |
getNativeIdentifierGeneratorClass()
Deprecated.
use
getNativeIdentifierGeneratorStrategy() instead |
String |
getNativeIdentifierGeneratorStrategy()
Resolves the native generation strategy associated to this dialect.
|
String |
getNoColumnsInsertString()
The fragment used to insert a row without specifying any column values.
|
String |
getNotExpression(String expression)
Deprecated.
todo (6.0): Remove
|
String |
getNullColumnString()
The keyword used to specify a nullable column.
|
String |
getNullColumnString(String columnType)
The keyword used to specify a nullable column.
|
NullOrdering |
getNullOrdering()
Returns the ordering of null.
|
int |
getPreferredSqlTypeCodeForBoolean()
The JDBC
type code to use for mapping
properties of Java type boolean. |
String |
getQueryHintString(String query,
List<String> hintList)
Apply a hint to the query.
|
String |
getQueryHintString(String query,
String hints)
Apply a hint to the query.
|
String |
getQuerySequencesString()
Get the select command used retrieve the names of all sequences.
|
String |
getRawTypeName(int code)
Get the name of the database type associated with the given
Types typecode, with no length, precision,
or scale. |
String |
getRawTypeName(JdbcTypeDescriptor jdbcTypeDescriptor) |
String |
getReadLockString(int timeout)
Get the string to append to SELECT statements to acquire READ locks
for this dialect.
|
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.
|
RowLockStrategy |
getReadRowLockStrategy()
The row lock strategy to use for read locks.
|
ResultSet |
getResultSet(CallableStatement statement)
Given a callable statement previously processed by
registerResultSetOutParameter(java.sql.CallableStatement, int),
extract the ResultSet from the OUT parameter. |
ResultSet |
getResultSet(CallableStatement statement,
int position)
Given a callable statement previously processed by
registerResultSetOutParameter(java.sql.CallableStatement, int),
extract the ResultSet. |
ResultSet |
getResultSet(CallableStatement statement,
String name)
Given a callable statement previously processed by
registerResultSetOutParameter(java.sql.CallableStatement, int),
extract the ResultSet from the OUT parameter. |
SchemaNameResolver |
getSchemaNameResolver()
Get the strategy for determining the schema name of a Connection
|
String |
getSelectClauseNullString(int sqlType)
Given a
Types type code, determine an appropriate
null value to use in a select clause. |
String |
getSelectGUIDString()
Get the command used to select a GUID from the underlying database.
|
String |
getSelectSequenceNextValString(String sequenceName)
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
Exporter<Sequence> |
getSequenceExporter() |
SequenceInformationExtractor |
getSequenceInformationExtractor()
A source of
SequenceInformation. |
String |
getSequenceNextValString(String sequenceName)
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
String |
getSequenceNextValString(String sequenceName,
int increment)
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
SequenceSupport |
getSequenceSupport() |
Dialect.SizeStrategy |
getSizeStrategy() |
SqlAstTranslatorFactory |
getSqlAstTranslatorFactory()
Return an SqlAstTranslatorFactory specific for the Dialect.
|
protected JdbcTypeDescriptor |
getSqlTypeDescriptorOverride(int sqlCode)
Returns the
JdbcTypeDescriptor that should be used to handle the given JDBC type code. |
SqmTranslatorFactory |
getSqmTranslatorFactory()
Return an SqmToSqlAstConverterFactory specific for the Dialect.
|
String |
getTableAliasSeparator()
The separator to use between a table name and its alias in a SQL
query, typically either
" as " where the spaces are
required, or a space character " ". |
String |
getTableComment(String comment)
Get the comment into a form supported for table definition.
|
Exporter<Table> |
getTableExporter() |
String |
getTableTypeString() |
String |
getTypeName(int code) |
String |
getTypeName(int code,
Size size)
Get the name of the database type associated with the given
java.sql.Types typecode.
|
String |
getTypeName(JdbcTypeDescriptor jdbcTypeDescriptor) |
String |
getTypeName(JdbcTypeDescriptor jdbcTypeDescriptor,
Size size)
Get the name of the database type associated with the given
SqlTypeDescriptor.
|
UniqueDelegate |
getUniqueDelegate()
Get the UniqueDelegate supported by this dialect
|
Exporter<Constraint> |
getUniqueKeyExporter() |
abstract int |
getVersion() |
ViolatedConstraintNameExtractor |
getViolatedConstraintNameExtractor() |
String |
getWriteLockString(int timeout)
Get the string to append to SELECT statements to acquire WRITE locks
for this dialect.
|
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.
|
RowLockStrategy |
getWriteRowLockStrategy()
The row lock strategy to use for write locks.
|
boolean |
hasAlterTable()
Does this dialect support the ALTER TABLE syntax?
|
boolean |
hasSelfReferentialForeignKeyBug()
Does the database/driver have bug in deleting rows that refer to other rows being deleted in the same query?
|
void |
initializeFunctionRegistry(QueryEngine queryEngine)
Initialize the given registry with any dialect-specific functions.
|
String |
inlineLiteral(String literal)
Inline String literal.
|
boolean |
isCurrentTimestampSelectStringCallable()
Deprecated.
no longer called
|
boolean |
isEmptyStringTreatedAsNull()
Return whether the dialect considers an empty-string value as null.
|
boolean |
isJdbcLogWarningsEnabledByDefault()
Does the fetching JDBC statement warning for logging is enabled by default
|
boolean |
isLockTimeoutParameterized()
If this dialect supports specifying lock timeouts, are those timeouts
rendered into the SQL string as parameters.
|
boolean |
isTypeNameRegistered(String typeName)
Whether or not the given type name has been registered for this dialect (including both hibernate type names and
custom-registered type names).
|
char |
openQuote()
The character specific to this dialect used to begin a quoted identifier.
|
protected String |
prependComment(String sql,
String comment) |
boolean |
qualifyIndexName()
Do we need to qualify index names with the schema name?
|
String |
quote(String name)
Apply dialect-specific quoting.
|
protected void |
registerColumnType(int code,
long capacity,
String name)
Subclasses register a type name for the given type code and maximum
column length.
|
protected void |
registerColumnType(int code,
String name)
Subclasses register a type name for the given type code.
|
protected void |
registerHibernateType(int code,
long capacity,
String name)
|
protected void |
registerHibernateType(int code,
String name)
|
protected void |
registerKeyword(String word) |
int |
registerResultSetOutParameter(CallableStatement statement,
int position)
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of
returning
ResultSet *by position*. |
int |
registerResultSetOutParameter(CallableStatement statement,
String name)
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of
returning
ResultSet *by name*. |
JdbcTypeDescriptor |
remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor)
Allows the dialect to override a
JdbcTypeDescriptor. |
String |
renderOrderByElement(String expression,
String collation,
String order,
NullPrecedence nulls)
Deprecated.
todo (6.0): remove?
|
boolean |
replaceResultVariableInOrderByClauseWithPosition()
Deprecated.
We now use ordinal rendering by default to produce smaller SQL
|
boolean |
requiresCastingOfParametersInSelectClause()
Deprecated.
Moved to
AbstractSqlAstTranslator |
boolean |
requiresFloatCastingOfIntegerDivision()
Does this dialect require that integer divisions be wrapped in cast()
calls to tell the db parser the expected type.
|
boolean |
requiresParensForTupleDistinctCounts()
If
supportsTupleDistinctCounts() is true, does the Dialect require the tuple to be wrapped with parens? |
JdbcTypeDescriptor |
resolveSqlTypeDescriptor(int jdbcTypeCode,
int precision,
int scale,
JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) |
boolean |
supportsBindAsCallableArgument()
Does this dialect support using a JDBC bind parameter as an argument
to a function or procedure call?
|
boolean |
supportsBitType()
|
boolean |
supportsCascadeDelete()
Does this dialect support cascaded delete on foreign key definitions?
|
boolean |
supportsCaseInsensitiveLike()
Does this dialect support case insensitive LIKE restrictions?
|
boolean |
supportsCircularCascadeDeleteConstraints()
Does this dialect support definition of cascade delete constraints
which can cause circular chains?
|
boolean |
supportsColumnCheck()
Does this dialect support column-level check constraints?
|
boolean |
supportsCommentOn()
Does this dialect/database support commenting on tables, columns, etc?
|
boolean |
supportsCurrentTimestampSelection()
Deprecated.
no longer called
|
boolean |
supportsEmptyInList()
Does this dialect support empty IN lists?
For example, is [where XYZ in ()] a supported construct?
|
boolean |
supportsExistsInSelect()
Does the dialect support an exists statement in the select clause?
|
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...
|
boolean |
supportsFetchClause(FetchClauseType type)
Does this dialect support the given fetch clause type.
|
boolean |
supportsFractionalTimestampArithmetic()
Whether the database supports adding a fractional interval to a timestamp
e.g.
|
boolean |
supportsIfExistsAfterAlterTable()
For an "alter table", can the phrase "if exists" be applied?
|
boolean |
supportsIfExistsAfterConstraintName()
For dropping a constraint with an "alter table", can the phrase "if exists" be applied after the constraint name?
NOTE : Only one or the other (or neither) of this and
supportsIfExistsBeforeConstraintName() should return true |
boolean |
supportsIfExistsAfterTableName()
For dropping a table, can the phrase "if exists" be applied after the table name?
NOTE : Only one or the other (or neither) of this and
supportsIfExistsBeforeTableName() should return true |
boolean |
supportsIfExistsBeforeConstraintName()
For dropping a constraint with an "alter table", can the phrase "if exists" be applied before the constraint name?
NOTE : Only one or the other (or neither) of this and
supportsIfExistsAfterConstraintName() should return true |
boolean |
supportsIfExistsBeforeTableName()
For dropping a table, can the phrase "if exists" be applied before the table name?
NOTE : Only one or the other (or neither) of this and
supportsIfExistsAfterTableName() should return true |
boolean |
supportsJdbcConnectionLobCreation(DatabaseMetaData databaseMetaData)
Check whether the JDBC
Connection supports creating LOBs via Connection.createBlob(),
Connection.createNClob() or Connection.createClob(). |
boolean |
supportsLimit()
Deprecated.
getLimitHandler() should be overridden instead. |
boolean |
supportsLimitOffset()
Deprecated.
getLimitHandler() should be overridden instead. |
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...
|
boolean |
supportsLockTimeouts()
Informational metadata about whether this dialect is known to support
specifying timeouts for requested lock acquisitions.
|
boolean |
supportsNamedParameters(DatabaseMetaData databaseMetaData)
Override the DatabaseMetaData#supportsNamedParameters()
|
boolean |
supportsNationalizedTypes()
Deprecated.
(since 6.0) Prefer
getNationalizationSupport() which gives a little
better insight into what is supported. This is interpreted as true if the supported
strategy is NationalizationSupport.EXPLICIT |
boolean |
supportsNoColumnsInsert()
Check if the INSERT statement is allowed to contain no column.
|
boolean |
supportsNonQueryWithCTE()
Does this dialect/database support non-query statements (e.g.
|
boolean |
supportsNotNullUnique()
Deprecated.
getUniqueDelegate() should be overridden instead. |
boolean |
supportsNoWait()
Does this dialect/database support NO_WAIT timeout.
|
boolean |
supportsNullPrecedence() |
boolean |
supportsOffsetInSubquery()
Does this dialect support offset in subqueries? Ex:
select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1 offset 1)
|
boolean |
supportsOrderByInSubquery()
Does this dialect support the order by clause in subqueries? Ex:
select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1)
|
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?
|
boolean |
supportsOuterJoinForUpdate()
Does this dialect support FOR UPDATE in conjunction with
outer joined rows?
|
boolean |
supportsParametersInInsertSelect()
Does this dialect support parameters within the SELECT clause of
INSERT ...
|
boolean |
supportsPartitionBy()
Does the underlying database support partition by
|
boolean |
supportsPooledSequences()
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
boolean |
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
Does this dialect support asking the result set its positioning
information on forward only cursors.
|
boolean |
supportsRowValueConstructorSyntax()
Deprecated.
Moved to
AbstractSqlAstTranslator |
boolean |
supportsRowValueConstructorSyntaxInInList()
Deprecated.
Moved to
AbstractSqlAstTranslator |
boolean |
supportsRowValueConstructorSyntaxInInSubquery()
Deprecated.
Moved to
AbstractSqlAstTranslator |
boolean |
supportsRowValueConstructorSyntaxInQuantifiedPredicates()
Deprecated.
Moved to
AbstractSqlAstTranslator |
boolean |
supportsRowValueConstructorSyntaxInSet()
Deprecated.
Moved to
AbstractSqlAstTranslator |
boolean |
supportsSelectAliasInGroupByClause() |
boolean |
supportsSelectQueryWithoutFromClause()
Deprecated.
Moved to
AbstractSqlAstTranslator |
boolean |
supportsSequences()
Deprecated.
implement
SequenceSupport and override getSequenceSupport() |
boolean |
supportsSkipLocked()
Does this dialect/database support SKIP_LOCKED timeout.
|
boolean |
supportsSubqueryInSelect()
Does this dialect support subqueries in the select clause? Ex:
select col1, (select col2 from Table2 where ..) from Table1
|
boolean |
supportsSubqueryOnMutatingTable()
Does this dialect support referencing the table being mutated in
a subquery.
|
boolean |
supportsSubselectAsInPredicateLHS()
Are subselects supported as the left-hand-side (LHS) of
IN-predicates.
|
boolean |
supportsTableCheck()
Does this dialect support table-level check constraints?
|
boolean |
supportsTemporalLiteralOffset()
Whether the Dialect supports timezone offset in temporal literals.
|
boolean |
supportsTemporaryTables() |
boolean |
supportsTimezoneTypes()
Whether the Dialect supports timezone types like
Types.TIMESTAMP_WITH_TIMEZONE. |
boolean |
supportsTruncateWithCast()
Does this dialect support truncation of values to a specified length through a cast?
|
boolean |
supportsTupleCounts()
Does this dialect support `count(a,b)`?
|
boolean |
supportsTupleDistinctCounts()
Does this dialect support `count(distinct a,b)`?
|
boolean |
supportsTuplesInSubqueries()
Deprecated.
|
boolean |
supportsUnboundedLobLocatorMaterialization()
Is it supported to materialize a LOB locator outside the transaction in
which it was created?
Again, part of the trickiness here is the fact that this is largely
driver dependent.
|
boolean |
supportsUnionAll()
Does this dialect support UNION ALL.
|
boolean |
supportsUnionInSubquery()
Does this dialect support UNION in a subquery.
|
boolean |
supportsUnique()
Deprecated.
getUniqueDelegate() should be overridden instead. |
boolean |
supportsUniqueConstraintInCreateAlterTable()
Deprecated.
getUniqueDelegate() should be overridden instead. |
boolean |
supportsValuesList()
Does this dialect/database support VALUES list (e.g.
|
boolean |
supportsValuesListForInsert()
Does this dialect/database support VALUES list (e.g.
|
boolean |
supportsVariableLimit()
Deprecated.
getLimitHandler() should be overridden instead. |
boolean |
supportsWait()
Does this dialect/database support WAIT timeout.
|
boolean |
supportsWindowFunctions()
Does this dialect support window functions like `row_number() over (..)`
|
String |
timestampaddPattern(TemporalUnit unit,
TemporalType temporalType)
Obtain a pattern for the SQL equivalent to a
timestampadd() function call. |
String |
timestampdiffPattern(TemporalUnit unit,
TemporalType fromTemporalType,
TemporalType toTemporalType)
Obtain a pattern for the SQL equivalent to a
timestampdiff() function call. |
String |
toBooleanValueString(boolean bool)
The SQL literal value to which this database maps boolean values.
|
String |
toString() |
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.
|
String |
translateDatetimeFormat(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). |
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. |
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. |
String |
trimPattern(TrimSpec specification,
char character)
Obtain a pattern for the SQL equivalent to a
trim() function call. |
boolean |
useFollowOnLocking(String sql,
QueryOptions queryOptions)
Some dialects have trouble applying pessimistic locking depending upon what other query options are
specified (paging, ordering, etc).
|
boolean |
useInputStreamToInsertBlob()
Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e.
|
boolean |
useMaxForLimit()
Deprecated.
getLimitHandler() should be overridden instead. |
protected String |
wrapDateLiteral(String date) |
protected String |
wrapTimeLiteral(String time) |
protected String |
wrapTimestampLiteral(String timestamp) |
public static final String DEFAULT_BATCH_SIZE
protected static final String NO_BATCH
public static final String QUOTE
public static final String CLOSED_QUOTE
public static final String TWO_SINGLE_QUOTES_REPLACEMENT
protected static final LobMergeStrategy LEGACY_LOB_MERGE_STRATEGY
protected static final LobMergeStrategy STREAM_XFER_LOB_MERGE_STRATEGY
protected static final LobMergeStrategy NEW_LOCATOR_LOB_MERGE_STRATEGY
protected final BatchLoadSizingStrategy STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY
public JdbcTypeDescriptor resolveSqlTypeDescriptor(int jdbcTypeCode, int precision, int scale, JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry)
protected static Size binaryToDecimalPrecision(int code, Size size)
public String getBooleanCheckCondition(String columnName, int sqlType, char falseChar, char trueChar)
public String getEnumCheckCondition(String columnName, int sqlType, Class<? extends Enum<?>> enumClass)
public abstract int getVersion()
public void initializeFunctionRegistry(QueryEngine queryEngine)
public String currentDate()
current_date function, which
maps to the Java type java.sql.Date, and of the HQL
local_date function which maps to the Java type
java.sql.LocalDate.public String currentTime()
current_time function, which
maps to the Java type java.sql.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.
public String currentTimestamp()
current_timestamp function,
which maps to the Java type java.sql.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.
public String currentLocalTime()
local_time function, which maps to
the Java type java.time.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.
public String currentLocalTimestamp()
local_datetime function, which maps
to the Java type java.time.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.
public String currentTimestampWithTimeZone()
offset_datetime function, which maps
to the Java type java.time.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.public String extractPattern(TemporalUnit unit)
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.
unit - the first argumentpublic String castPattern(CastType from, CastType to)
cast() function call. The resulting
pattern must contain ?1 and ?2 placeholders
for the arguments.public String trimPattern(TrimSpec specification, char character)
trim() function call. The resulting
pattern must contain a ?1 placeholder for the
argument of type String.specification - leading or trailingcharacter - the character to trimpublic boolean supportsFractionalTimestampArithmetic()
public String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType)
timestampdiff() function call. The resulting
pattern must contain ?1, ?2, and ?3 placeholders
for the arguments.unit - the first argumentfromTemporalType - true if the first argument is
a timestamp, false if a datetoTemporalType - true if the second argument ispublic String timestampaddPattern(TemporalUnit unit, TemporalType temporalType)
timestampadd() function call. The resulting
pattern must contain ?1, ?2, and ?3 placeholders
for the arguments.unit - the first argumenttemporalType - true if the third argument is apublic boolean equivalentTypes(int typeCode1,
int typeCode2)
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.typeCode1 - the first JDBC type codetypeCode2 - the second JDBC type codetrue if the two type codes are equivalent@Deprecated public static Dialect getDialect() throws HibernateException
DialectResolutionInfo.HibernateException - If no dialect was specified, or if it could not be instantiated.@Deprecated public static Dialect getDialect(Properties props) throws HibernateException
DialectResolutionInfo.props - The properties to use for finding the dialect class to use.HibernateException - If no dialect was specified, or if it could not be instantiated.public final Properties getDefaultProperties()
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
typeContributions - Callback to contribute the typesserviceRegistry - The service registrypublic String getRawTypeName(int code) throws HibernateException
Types typecode, with no length, precision,
or scale.code - The Types typecodeHibernateException - If no mapping was specified for that type.public String getRawTypeName(JdbcTypeDescriptor jdbcTypeDescriptor) throws HibernateException
HibernateExceptionpublic String getTypeName(JdbcTypeDescriptor jdbcTypeDescriptor) throws HibernateException
HibernateExceptionpublic String getTypeName(int code) throws HibernateException
HibernateExceptionpublic String getTypeName(int code, Size size) throws HibernateException
code - java.sql.Types typecodesize - the length, precision, scale of the columnHibernateExceptionpublic String getTypeName(JdbcTypeDescriptor jdbcTypeDescriptor, Size size)
jdbcTypeDescriptor - the SQL typesize - the length, precision, scale of the columnpublic String getCastTypeName(SqlExpressable type, Long length, Integer precision, Integer scale)
SqlExpressable
SQL type.protected void registerColumnType(int code,
long capacity,
String name)
code - The Types typecodecapacity - The maximum length of database typename - The database type nameprotected void registerColumnType(int code,
String name)
code - The Types typecodename - The database type namepublic JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor)
JdbcTypeDescriptor.
If the passed sqlTypeDescriptor allows itself to be remapped (per
JdbcTypeDescriptor.canBeRemapped()), then this method uses
getSqlTypeDescriptorOverride(int) to get an optional override based on the SQL code returned by
JdbcTypeDescriptor.getJdbcTypeCode().
If this dialect does not provide an override or if the sqlTypeDescriptor does not allow itself to be
remapped, then this method simply returns the original passed sqlTypeDescriptorjdbcTypeDescriptor - The JdbcTypeDescriptor to overrideJdbcTypeDescriptor that should be used for this dialect;
if there is no override, then original sqlTypeDescriptor is returned.IllegalArgumentException - if sqlTypeDescriptor is null.getSqlTypeDescriptorOverride(int)protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode)
JdbcTypeDescriptor that should be used to handle the given JDBC type code. Returns
null if there is no override.sqlCode - A Types constant indicating the SQL column typeJdbcTypeDescriptor to use as an override, or null if there is no override.public LobMergeStrategy getLobMergeStrategy()
public String getHibernateTypeName(int code) throws HibernateException
code - The Types type codeType name.HibernateException - If no mapping was specified for that type.public boolean isTypeNameRegistered(String typeName)
typeName - the type name.public String getHibernateTypeName(int code, Integer length, Integer precision, Integer scale) throws HibernateException
Type associated
with the given Types typecode with the given storage
specification parameters.code - The Types typecodelength - The datatype lengthprecision - The datatype precisionscale - The datatype scaleType name.HibernateException - If no mapping was specified for that type.protected void registerHibernateType(int code,
long capacity,
String name)
protected void registerHibernateType(int code,
String name)
@Deprecated public Class getNativeIdentifierGeneratorClass()
getNativeIdentifierGeneratorStrategy() insteadIdentifierGenerator)
which acts as this dialects native generation strategy.
Comes into play whenever the user specifies the native generator.public String getNativeIdentifierGeneratorStrategy()
public IdentityColumnSupport getIdentityColumnSupport()
IdentityColumnSupportpublic SequenceSupport getSequenceSupport()
public String getQuerySequencesString()
SchemaUpdatepublic SequenceInformationExtractor getSequenceInformationExtractor()
SequenceInformation.public String getSelectGUIDString()
@Deprecated public String getFromDual()
AbstractSqlAstTranslatorfrom dual.@Deprecated public boolean supportsSelectQueryWithoutFromClause()
AbstractSqlAstTranslatorpublic boolean supportsTemporaryTables()
public LimitHandler getLimitHandler()
LimitHandler that implements support for
Query.setMaxResults(int) and
Query.setFirstResult(int) for
this dialect.public boolean supportsLockTimeouts()
public boolean isLockTimeoutParameterized()
PreparedStatement. If true, the param 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.public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode)
lockable - The persister for the entity to be locked.lockMode - The type of lock to be acquired.public String getForUpdateString(LockOptions lockOptions)
lockOptions - contains the lock mode to apply.public String getForUpdateString(LockMode lockMode)
lockMode - The lock mode to apply.public String getForUpdateString()
public String getWriteLockString(int timeout)
timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public String getWriteLockString(String aliases, int timeout)
aliases - The columns to be read locked.timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public String getReadLockString(int timeout)
timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public String getReadLockString(String aliases, int timeout)
aliases - The columns to be read locked.timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.@Deprecated public boolean forUpdateOfColumns()
getWriteRowLockStrategy() insteadpublic RowLockStrategy getWriteRowLockStrategy()
public RowLockStrategy getReadRowLockStrategy()
public boolean supportsOuterJoinForUpdate()
public String getForUpdateString(String aliases)
aliases - The columns to be write locked.public String getForUpdateString(String aliases, LockOptions lockOptions)
aliases - The columns to be write locked.lockOptions - the lock options to applypublic String getForUpdateNowaitString()
public String getForUpdateSkipLockedString()
public String getForUpdateNowaitString(String aliases)
aliases - The columns to be write locked.public String getForUpdateSkipLockedString(String aliases)
aliases - The columns to be write locked.@Deprecated public String appendLockHint(LockMode mode, String tableName)
appendLockHint(LockOptions,String) insteadmode - The lock mode to applytableName - The name of the table to which to apply the lock hint.@Deprecated public String appendLockHint(LockOptions lockOptions, String tableName)
AbstractSqlAstTranslatorlockOptions - The lock options to applytableName - The name of the table to which to apply the lock hint.public String applyLocksToSql(String sql, LockOptions aliasedLockOptions, Map<String,String[]> keyColumnNames)
sql - the SQL string to modifyaliasedLockOptions - lock options indexed by aliased table names.keyColumnNames - a map of key columns indexed by aliased table names.public String getCreateTableString()
public String getAlterTableString(String tableName)
tableName - The name of the table to alterpublic String getCreateMultisetTableString()
getCreateTableString(). Here, we have the
command used to create a table when there is no primary key and
duplicate rows are expected.
Most databases do not care about the distinction; originally added for
Teradata support which does care.public SqmMultiTableMutationStrategy getFallbackSqmMutationStrategy(EntityMappingType entityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext)
public int registerResultSetOutParameter(CallableStatement statement, int position) throws SQLException
ResultSet *by position*. Pre-Java 8, registering such ResultSet-returning
parameters varied greatly across database and drivers; hence its inclusion as part of the Dialect contract.statement - The callable statement.position - The bind position at which to register the output param.SQLException - Indicates problems registering the param.public int registerResultSetOutParameter(CallableStatement statement, String name) throws SQLException
ResultSet *by name*. Pre-Java 8, registering such ResultSet-returning
parameters varied greatly across database and drivers; hence its inclusion as part of the Dialect contract.statement - The callable statement.name - The parameter name (for drivers which support named parameters).SQLException - Indicates problems registering the param.public ResultSet getResultSet(CallableStatement statement) throws SQLException
registerResultSetOutParameter(java.sql.CallableStatement, int),
extract the ResultSet from the OUT parameter.statement - The callable statement.SQLException - Indicates problems extracting the result set.public ResultSet getResultSet(CallableStatement statement, int position) throws SQLException
registerResultSetOutParameter(java.sql.CallableStatement, int),
extract the ResultSet.statement - The callable statement.position - The bind position at which to register the output param.SQLException - Indicates problems extracting the result set.public ResultSet getResultSet(CallableStatement statement, String name) throws SQLException
registerResultSetOutParameter(java.sql.CallableStatement, int),
extract the ResultSet from the OUT parameter.statement - The callable statement.name - The parameter name (for drivers which support named parameters).SQLException - Indicates problems extracting the result set.@Deprecated public boolean supportsCurrentTimestampSelection()
@Deprecated public boolean isCurrentTimestampSelectStringCallable()
getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape
syntax is being used...getCurrentTimestampSelectString() return
is callable; false otherwise.@Deprecated public String getCurrentTimestampSelectString()
currentTimestamp()@Deprecated public String getCurrentTimestampSQLFunctionName()
currentTimestamp(),
currentLocalTimestamp(), or
currentTimestampWithTimeZone().@Deprecated public SQLExceptionConverter buildSQLExceptionConverter()
buildSQLExceptionConversionDelegate() should be
overridden instead.buildSQLExceptionConversionDelegate() should be overridden
instead.
If this method is not overridden, the default SQLExceptionConverter
implementation executes 3 SQLException converter delegates:
buildSQLExceptionConversionDelegate();
(it is strongly recommended that specific Dialect implementations
override buildSQLExceptionConversionDelegate())SQLExceptionConverter interpret SQL errors based on
vendor-specific error codes rather than the SQLState since the
interpretation is more accurate when using vendor-specific ErrorCodes.SQLExceptionConverter should be used.buildSQLExceptionConversionDelegate()public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
SQLExceptionConversionDelegate for
interpreting dialect-specific error or SQLState codes.
When buildSQLExceptionConverter() returns null, the default
SQLExceptionConverter is used to interpret SQLState and
error 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:
public ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor()
getViolatedConstraintNameExtractor in interface ConversionContextpublic String getSelectClauseNullString(int sqlType)
Types type code, determine an appropriate
null value to use in a select clause.
One thing to consider here is that certain databases might
require proper casting for the nulls here since the select here
will be part of a UNION/UNION ALL.sqlType - The Types type code.public boolean supportsUnionAll()
public boolean supportsUnionInSubquery()
@Deprecated public JoinFragment createOuterJoinFragment()
JoinFragmentJoinFragment strategy responsible
for handling this dialect's variations in how joins are handled.JoinFragment strategy.@Deprecated public CaseFragment createCaseFragment()
CaseFragmentCaseFragment strategy responsible
for handling this dialect's variations in how CASE statements are
handled.CaseFragment strategy.public String getNoColumnsInsertString()
public boolean supportsNoColumnsInsert()
public String getLowercaseFunction()
public String getCaseInsensitiveLike()
public boolean supportsCaseInsensitiveLike()
true if the underlying database supports case insensitive like comparison,
false otherwise. The default is false.public boolean supportsTruncateWithCast()
true if the underlying database supports truncation through a cast,
false otherwise. The default is true.public String transformSelectString(String select)
select - The select commandpublic int getMaxAliasLength()
public String toBooleanValueString(boolean bool)
bool - The boolean valueprotected void registerKeyword(String word)
@Deprecated public Set<String> getKeywords()
buildIdentifierHelper(org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder, java.sql.DatabaseMetaData) insteadpublic IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException
null is allowed and indicates that Hibernate should fallback to building a
"standard" helper. In the fallback path, any changes made to the IdentifierHelperBuilder
during this call will still be incorporated into the built IdentifierHelper.
The incoming builder will have the following set:IdentifierHelperBuilder.isGloballyQuoteIdentifiers()IdentifierHelperBuilder.getUnquotedCaseStrategy() - initialized to UPPERIdentifierHelperBuilder.getQuotedCaseStrategy() - initialized to MIXEDIdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
AnsiSqlKeywords.sql2003() as reserved wordsbuilder - A semi-configured IdentifierHelper builder.dbMetaData - Access to the metadata returned from the driver if needed and if available. WARNING: may be nullnull to indicate Hibernate should use its fallback pathSQLException - Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.getNameQualifierSupport()public char openQuote()
public char closeQuote()
public final String quote(String name)
name - The value to be quoted.openQuote(),
closeQuote()public Exporter<ForeignKey> getForeignKeyExporter()
public Exporter<Constraint> getUniqueKeyExporter()
public Exporter<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectExporter()
public boolean canCreateCatalog()
public String[] getCreateCatalogCommand(String catalogName)
catalogName - The name of the catalog to be created.public String[] getDropCatalogCommand(String catalogName)
catalogName - The name of the catalog to be dropped.public boolean canCreateSchema()
public String[] getCreateSchemaCommand(String schemaName)
schemaName - The name of the schema to be created.public String[] getDropSchemaCommand(String schemaName)
schemaName - The name of the schema to be dropped.public String getCurrentSchemaCommand()
getSchemaNameResolver(), unless the return from there does not need this
information. E.g., a custom impl might make use of the Java 1.7 addition of
the Connection.getSchema() methodpublic SchemaNameResolver getSchemaNameResolver()
public boolean hasAlterTable()
public boolean dropConstraints()
public boolean qualifyIndexName()
public String getAddColumnString()
public String getAddColumnSuffixString()
public String getDropForeignKeyString()
public String getTableTypeString()
public String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey)
constraintName - The FK constraint name.foreignKey - The names of the columns comprising the FKreferencedTable - The table referenced by the FKprimaryKey - The explicit columns in the referencedTable referenced
by this FK.referencesPrimaryKey - if false, constraint should be
explicit about which column names the constraint refers topublic String getAddForeignKeyConstraintString(String constraintName, String foreignKeyDefinition)
public String getAddPrimaryKeyConstraintString(String constraintName)
constraintName - The name of the PK constraint.public boolean hasSelfReferentialForeignKeyBug()
true if the database/driver has this bugpublic String getNullColumnString()
public String getNullColumnString(String columnType)
public boolean supportsCommentOn()
true if commenting is supportedpublic String getTableComment(String comment)
comment - The comment to applypublic String getColumnComment(String comment)
comment - The comment to applypublic boolean supportsIfExistsBeforeTableName()
supportsIfExistsAfterTableName() should return truetrue if the "if exists" can be applied before the table namepublic boolean supportsIfExistsAfterTableName()
supportsIfExistsBeforeTableName() should return truetrue if the "if exists" can be applied after the table namepublic boolean supportsIfExistsBeforeConstraintName()
supportsIfExistsAfterConstraintName() should return truetrue if the "if exists" can be applied before the constraint namepublic boolean supportsIfExistsAfterConstraintName()
supportsIfExistsBeforeConstraintName() should return truetrue if the "if exists" can be applied after the constraint namepublic boolean supportsIfExistsAfterAlterTable()
true if the "if exists" can be applied after ALTER TABLEpublic String getDropTableString(String tableName)
tableName - The name of the table to droppublic boolean supportsColumnCheck()
public boolean supportsTableCheck()
public boolean supportsCascadeDelete()
true indicates that the dialect does support cascaded delete on foreign keys.public String getCascadeConstraintsString()
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.public String getCrossJoinSeparator()
" cross join " or a comma ", ",
where the spaces are required.public String getTableAliasSeparator()
" as " where the spaces are
required, or a space character " ".public ColumnAliasExtractor getColumnAliasExtractor()
public boolean supportsEmptyInList()
public boolean areStringComparisonsCaseInsensitive()
@Deprecated public boolean supportsRowValueConstructorSyntax()
AbstractSqlAstTranslator@Deprecated public boolean supportsRowValueConstructorSyntaxInSet()
AbstractSqlAstTranslator@Deprecated public boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates()
AbstractSqlAstTranslator@Deprecated public boolean supportsRowValueConstructorSyntaxInInList()
AbstractSqlAstTranslatorrow values,
does it offer such support in IN lists as well?
For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..."@Deprecated public boolean supportsRowValueConstructorSyntaxInInSubquery()
AbstractSqlAstTranslator@Deprecated public GroupBySummarizationRenderingStrategy getGroupBySummarizationRenderingStrategy()
AbstractSqlAstTranslator@Deprecated public GroupByConstantRenderingStrategy getGroupByConstantRenderingStrategy()
AbstractSqlAstTranslatorpublic boolean useInputStreamToInsertBlob()
PreparedStatement.setBinaryStream(int, java.io.InputStream, int)).public boolean supportsParametersInInsertSelect()
@Deprecated public boolean replaceResultVariableInOrderByClauseWithPosition()
supportsOrdinalSelectItemReference()public boolean supportsOrdinalSelectItemReference()
public NullOrdering getNullOrdering()
public boolean supportsNullPrecedence()
@Deprecated public String renderOrderByElement(String expression, String collation, String order, NullPrecedence nulls)
expression - The SQL order expression. In case of @OrderBy annotation user receives property placeholder
(e.g. attribute name enclosed in '{' and '}' signs).collation - Collation string in format collate IDENTIFIER, or null
if expression has not been explicitly specified.order - Order direction. Possible values: asc, desc, or null
if expression has not been explicitly specified.nulls - Nulls precedence. Default value: NullPrecedence.NONE.ORDER BY clause.@Deprecated public boolean requiresCastingOfParametersInSelectClause()
AbstractSqlAstTranslatorpublic boolean requiresFloatCastingOfIntegerDivision()
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
ResultSet.isAfterLast() and
ResultSet.isBeforeFirst(). Certain drivers do not
allow access to these methods for forward only cursors.
NOTE : this is highly driver dependent!ResultSet.isAfterLast() and
ResultSet.isBeforeFirst() are supported for forward
only cursors; false otherwise.public boolean supportsCircularCascadeDeleteConstraints()
public boolean supportsSubselectAsInPredicateLHS()
... <subquery> IN (1, 2, 3) ... supported?public boolean supportsExpectedLobUsagePattern()
public boolean supportsLobValueChangePropagation()
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).
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().public boolean supportsUnboundedLobLocatorMaterialization()
supportsExpectedLobUsagePattern()
also support the ability to materialize a LOB outside the owning transaction...public boolean supportsSubqueryOnMutatingTable()
public boolean supportsExistsInSelect()
public boolean doesReadCommittedCauseWritersToBlockReaders()
public boolean doesRepeatableReadCauseReadersToBlockWriters()
public boolean supportsBindAsCallableArgument()
true if the database supports accepting bind params as args, false otherwise. The
default is true.public boolean supportsTupleCounts()
public boolean supportsTupleDistinctCounts()
public boolean requiresParensForTupleDistinctCounts()
supportsTupleDistinctCounts() is true, does the Dialect require the tuple to be wrapped with parens?public int getInExpressionCountLimit()
IN predicate.
If the database defines no such limits, simply return zero or less-than-zero.public boolean forceLobAsLastValue()
public boolean isEmptyStringTreatedAsNull()
public boolean useFollowOnLocking(String sql, QueryOptions queryOptions)
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..@Deprecated public String getNotExpression(String expression)
expression - The expression to negatepublic UniqueDelegate getUniqueDelegate()
@Deprecated public boolean supportsUnique()
getUniqueDelegate() should be overridden instead.@Deprecated public boolean supportsUniqueConstraintInCreateAlterTable()
getUniqueDelegate() should be overridden instead.@Deprecated public String getAddUniqueConstraintString(String constraintName)
getUniqueDelegate() should be overridden instead.constraintName - The name of the unique constraint.@Deprecated public boolean supportsNotNullUnique()
getUniqueDelegate() should be overridden instead.public String getQueryHintString(String query, List<String> hintList)
query - The query to which to apply the hint.hintList - The hints to applypublic String getQueryHintString(String query, String hints)
query - The query to which to apply the hint.hints - The hints to applypublic ScrollMode defaultScrollMode()
@Deprecated public boolean supportsTuplesInSubqueries()
supportsRowValueConstructorSyntaxInInSubquery()public boolean supportsOffsetInSubquery()
public boolean supportsOrderByInSubquery()
public boolean supportsSubqueryInSelect()
public boolean supportsFetchClause(FetchClauseType type)
type - The fetch clause typetrue if the underlying database supports the given fetch clause type,
false otherwise. The default is false.public boolean supportsWindowFunctions()
true if the underlying database supports window functions,
false otherwise. The default is false.public CallableStatementSupport getCallableStatementSupport()
public NameQualifierSupport getNameQualifierSupport()
public BatchLoadSizingStrategy getDefaultBatchLoadSizingStrategy()
public boolean isJdbcLogWarningsEnabledByDefault()
public boolean supportsPartitionBy()
public boolean supportsNamedParameters(DatabaseMetaData databaseMetaData) throws SQLException
SQLException - Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.@Deprecated public final boolean supportsNationalizedTypes()
getNationalizationSupport() which gives a little
better insight into what is supported. This is interpreted as true if the supported
strategy is NationalizationSupport.EXPLICITpublic NationalizationSupport getNationalizationSupport()
public int getPreferredSqlTypeCodeForBoolean()
type code to use for mapping
properties of Java type boolean.
Usually Types.BOOLEAN or Types.BIT.
Types.public boolean supportsNonQueryWithCTE()
true if non-query statements are supported with CTEpublic boolean supportsValuesList()
true if VALUES list are supportedpublic boolean supportsValuesListForInsert()
true if VALUES list are supported for insert statementspublic boolean supportsSkipLocked()
true if SKIP_LOCKED is supportedpublic boolean supportsNoWait()
true if NO_WAIT is supportedpublic boolean supportsWait()
true if WAIT is supportedpublic String inlineLiteral(String literal)
public boolean supportsJdbcConnectionLobCreation(DatabaseMetaData databaseMetaData)
Connection supports creating LOBs via Connection.createBlob(),
Connection.createNClob() or Connection.createClob().databaseMetaData - JDBC DatabaseMetaData which can be used if LOB creation is supported only starting from a given Driver versiontrue if LOBs can be created via the JDBC Connection.protected String escapeLiteral(String literal)
public String addSqlHintOrComment(String sql, QueryOptions queryOptions, boolean commentsEnabled)
public HqlTranslator getHqlTranslator()
null
to use Hibernate's standard translator.
Note that QueryEngineOptions.getCustomHqlTranslator() has higher precedenceStandardHqlTranslator,
QueryEngine.getHqlTranslator()public SqmTranslatorFactory getSqmTranslatorFactory()
null
to use Hibernate's standard translator.
Note that QueryEngineOptions.getCustomSqmTranslatorFactory() has higher
precedence as it comes directly from the user configStandardSqmTranslator,
QueryEngine.getSqmTranslatorFactory()public SqlAstTranslatorFactory getSqlAstTranslatorFactory()
null
to use Hibernate's standard translator.public boolean supportsSelectAliasInGroupByClause()
public Dialect.SizeStrategy getSizeStrategy()
public long getDefaultLobLength()
public int getDefaultDecimalPrecision()
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.
public int getDefaultTimestampPrecision()
Timestamp or
LocalDateTime.
Usually 6 (microseconds) or 3 (milliseconds).
public int getFloatPrecision()
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.
public int getDoublePrecision()
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.
public long getFractionalSecondPrecisionInNanos()
TemporalUnit.
Usually 1 (nanoseconds), 1_000 (microseconds), or 1_000_000 (milliseconds).
TemporalUnit.NATIVEpublic boolean supportsBitType()
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?BIT or BOOLEAN typepublic String formatBinaryLiteral(byte[] bytes)
public RowLockStrategy getLockRowIdentifier(LockMode lockMode)
public String translateDatetimeFormat(String format)
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 all of
the pattern letter sequences understood by
DateTimeFormatter, only the following
subset of pattern letters is accepted by
Hibernate:
public String translateExtractField(TemporalUnit unit)
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.
public String translateDurationField(TemporalUnit unit)
#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.
public String formatDateTimeLiteral(TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone)
protected String formatAsTimestamp(TemporalAccessor temporalAccessor, TimeZone jdbcTimeZone)
public String formatDateTimeLiteral(Date date, TemporalType precision, TimeZone jdbcTimeZone)
public String formatDateTimeLiteral(Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone)
public boolean supportsTemporalLiteralOffset()
public boolean supportsTimezoneTypes()
Types.TIMESTAMP_WITH_TIMEZONE.@Deprecated public boolean supportsLimit()
getLimitHandler() should be overridden instead.@Deprecated public boolean supportsLimitOffset()
getLimitHandler() should be overridden instead.@Deprecated public boolean supportsVariableLimit()
getLimitHandler() should be overridden instead.@Deprecated public boolean bindLimitParametersInReverseOrder()
getLimitHandler() should be overridden instead.@Deprecated public boolean bindLimitParametersFirst()
getLimitHandler() should be overridden instead.@Deprecated public boolean useMaxForLimit()
getLimitHandler() should be overridden instead.@Deprecated public boolean forceLimitUsage()
getLimitHandler() should be overridden instead.@Deprecated public String getLimitString(String query, int offset, int limit)
getLimitHandler() should be overridden instead.@Deprecated protected String getLimitString(String query, boolean hasOffset)
getLimitHandler() should be overridden instead.@Deprecated public int convertToFirstRowValue(int zeroBasedFirstResult)
getLimitHandler() should be overridden instead.@Deprecated public boolean supportsSequences()
SequenceSupport and override getSequenceSupport()@Deprecated public boolean supportsPooledSequences()
SequenceSupport and override getSequenceSupport()@Deprecated public String getSequenceNextValString(String sequenceName) throws MappingException
SequenceSupport and override getSequenceSupport()MappingException@Deprecated public String getSelectSequenceNextValString(String sequenceName) throws MappingException
SequenceSupport and override getSequenceSupport()MappingException@Deprecated public String getSequenceNextValString(String sequenceName, int increment) throws MappingException
SequenceSupport and override getSequenceSupport()MappingException@Deprecated public String[] getCreateSequenceStrings(String sequenceName, int initialValue, int incrementSize) throws MappingException
SequenceSupport and override getSequenceSupport()MappingException@Deprecated protected String getCreateSequenceString(String sequenceName) throws MappingException
SequenceSupport and override getSequenceSupport()MappingException@Deprecated protected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) throws MappingException
SequenceSupport and override getSequenceSupport()MappingException@Deprecated public String[] getDropSequenceStrings(String sequenceName) throws MappingException
SequenceSupport and override getSequenceSupport()MappingException@Deprecated protected String getDropSequenceString(String sequenceName) throws MappingException
SequenceSupport and override getSequenceSupport()MappingExceptionpublic String getCreateTemporaryTableColumnAnnotation(int sqlTypeCode)
sqlTypeCode - The SQL type codeCopyright © 2001-2021 Red Hat, Inc. All Rights Reserved.