Package org.hibernate.dialect
Class DB2Dialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.DB2Dialect
-
- All Implemented Interfaces:
ConversionContext
- Direct Known Subclasses:
DB2390Dialect
,DB2400Dialect
,DB297Dialect
,DB2SpatialDialect
,DerbyDialect
public class DB2Dialect extends Dialect
An SQL dialect for DB2.
-
-
Field Summary
-
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, NO_BATCH, QUOTE, STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description DB2Dialect()
Constructs a DB2Dialect
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SQLExceptionConversionDelegate
buildSQLExceptionConversionDelegate()
Build an instance of aSQLExceptionConversionDelegate
for interpreting dialect-specific error or SQLState codes.int
convertToFirstRowValue(int zeroBasedFirstResult)
Hibernate APIs explicitly state that setFirstResult() should be a zero-based offset.boolean
doesReadCommittedCauseWritersToBlockReaders()
For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?boolean
dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?java.lang.String
getAddColumnString()
The syntax used to add a column to a table (optional).java.lang.String
getCreateSequenceString(java.lang.String sequenceName)
Typically dialects which support sequences can create a sequence with a single command.java.lang.String
getCrossJoinSeparator()
Returns the separator to use for defining cross joins when translating HQL queries.java.lang.String
getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestamp from the database.MultiTableBulkIdStrategy
getDefaultMultiTableBulkIdStrategy()
java.lang.String
getDropSequenceString(java.lang.String sequenceName)
Typically dialects which support sequences can drop a sequence with a single command.java.lang.String
getForUpdateString()
Get the string to append to SELECT statements to acquire locks for this dialect.IdentityColumnSupport
getIdentityColumnSupport()
Get the appropriateIdentityColumnSupport
LimitHandler
getLimitHandler()
Returns the delegate managing LIMIT clause.java.lang.String
getLimitString(java.lang.String sql, int offset, int limit)
Given a limit and an offset, apply the limit clause to the query.java.lang.String
getLowercaseFunction()
The name of the SQL function that transforms a string to lowercasejava.lang.String
getNotExpression(java.lang.String expression)
Negate an expressionjava.lang.String
getQuerySequencesString()
Get the select command used retrieve the names of all sequences.java.sql.ResultSet
getResultSet(java.sql.CallableStatement ps)
Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
, extract theResultSet
from the OUT parameter.java.lang.String
getSelectClauseNullString(int sqlType)
Given aTypes
type code, determine an appropriate null value to use in a select clause.java.lang.String
getSelectSequenceNextValString(java.lang.String sequenceName)
Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.java.lang.String
getSequenceNextValString(java.lang.String sequenceName)
Generate the appropriate select statement to to retrieve the next value of a sequence.protected SqlTypeDescriptor
getSqlTypeDescriptorOverride(int sqlCode)
Returns theSqlTypeDescriptor
that should be used to handle the given JDBC type code.UniqueDelegate
getUniqueDelegate()
Get the UniqueDelegate supported by this dialectboolean
isCurrentTimestampSelectStringCallable()
Should the value returned byDialect.getCurrentTimestampSelectString()
be treated as callable.int
registerResultSetOutParameter(java.sql.CallableStatement statement, int col)
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet
*by position*.java.lang.String
renderOrderByElement(java.lang.String expression, java.lang.String collation, java.lang.String order, NullPrecedence nullPrecedence)
Handle DB2 "support" for null precedence...boolean
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.boolean
supportsCommentOn()
Does this dialect/database support commenting on tables, columns, etc?boolean
supportsCurrentTimestampSelection()
Does this dialect support a way to retrieve the database's current timestamp value?boolean
supportsEmptyInList()
Does this dialect support empty IN lists?boolean
supportsExistsInSelect()
Does the dialect support an exists statement in the select clause?boolean
supportsLimit()
Does this dialect support some form of limiting query results via a SQL clause?boolean
supportsLobValueChangePropogation()
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
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 byboolean
supportsPooledSequences()
Does this dialect support "pooled" sequences.boolean
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
Does this dialect support asking the result set its positioning information on forward only cursors.boolean
supportsSequences()
Does this dialect support sequences?boolean
supportsTupleDistinctCounts()
Does this dialect support `count(distinct a,b)`?boolean
supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster variant of UNION?boolean
supportsVariableLimit()
Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?boolean
useMaxForLimit()
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentRecognizedTableTypes, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, contributeTypes, createCaseFragment, createOuterJoinFragment, defaultScrollMode, doesRepeatableReadCauseReadersToBlockWriters, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCurrentSchemaCommand, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getMaxAliasLength, getNameQualifierSupport, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNullColumnString, getQueryHintString, getQueryHintString, getReadLockString, getReadLockString, getResultSet, getResultSet, getSchemaNameResolver, getSelectGUIDString, getSequenceExporter, getSequenceInformationExtractor, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueKeyExporter, getViolatedConstraintNameExtracter, getWriteLockString, getWriteLockString, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, remapSqlTypeDescriptor, replaceResultVariableInOrderByClauseWithPosition, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsLimitOffset, supportsNamedParameters, supportsNationalizedTypes, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTuplesInSubqueries, supportsUnboundedLobLocatorMaterialization, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob
-
-
-
-
Method Detail
-
getLowercaseFunction
public java.lang.String getLowercaseFunction()
Description copied from class:Dialect
The name of the SQL function that transforms a string to lowercase- Overrides:
getLowercaseFunction
in classDialect
- Returns:
- The dialect-specific lowercase function.
-
getAddColumnString
public java.lang.String getAddColumnString()
Description copied from class:Dialect
The syntax used to add a column to a table (optional).- Overrides:
getAddColumnString
in classDialect
- Returns:
- The "add column" fragment.
-
dropConstraints
public boolean dropConstraints()
Description copied from class:Dialect
Do we need to drop constraints before dropping tables in this dialect?- Overrides:
dropConstraints
in classDialect
- Returns:
- True if constraints must be dropped prior to dropping the table; false otherwise.
-
getSequenceNextValString
public java.lang.String getSequenceNextValString(java.lang.String sequenceName)
Description copied from class:Dialect
Generate the appropriate select statement to to retrieve the next value of a sequence. This should be a "stand alone" select statement.- Overrides:
getSequenceNextValString
in classDialect
- Parameters:
sequenceName
- the name of the sequence- Returns:
- String The "nextval" select string.
-
getSelectSequenceNextValString
public java.lang.String getSelectSequenceNextValString(java.lang.String sequenceName) throws MappingException
Description copied from class:Dialect
Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement. This differs fromDialect.getSequenceNextValString(String)
in that this should return an expression usable within another statement.- Overrides:
getSelectSequenceNextValString
in classDialect
- Parameters:
sequenceName
- the name of the sequence- Returns:
- The "nextval" fragment.
- Throws:
MappingException
- If sequences are not supported.
-
getCreateSequenceString
public java.lang.String getCreateSequenceString(java.lang.String sequenceName)
Description copied from class:Dialect
Typically dialects which support sequences can create a sequence with a single command. This is convenience form ofDialect.getCreateSequenceStrings(java.lang.String)
to help facilitate that. Dialects which support sequences and can create a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to create a sequence should instead overrideDialect.getCreateSequenceStrings(java.lang.String)
.- Overrides:
getCreateSequenceString
in classDialect
- Parameters:
sequenceName
- The name of the sequence- Returns:
- The sequence creation command
-
getDropSequenceString
public java.lang.String getDropSequenceString(java.lang.String sequenceName)
Description copied from class:Dialect
Typically dialects which support sequences can drop a sequence with a single command. This is convenience form ofDialect.getDropSequenceStrings(java.lang.String)
to help facilitate that. Dialects which support sequences and can drop a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to drop a sequence should instead overrideDialect.getDropSequenceStrings(java.lang.String)
.- Overrides:
getDropSequenceString
in classDialect
- Parameters:
sequenceName
- The name of the sequence- Returns:
- The sequence drop commands
-
supportsSequences
public boolean supportsSequences()
Description copied from class:Dialect
Does this dialect support sequences?- Overrides:
supportsSequences
in classDialect
- Returns:
- True if sequences supported; false otherwise.
-
supportsPooledSequences
public boolean supportsPooledSequences()
Description copied from class:Dialect
Does this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?- Overrides:
supportsPooledSequences
in classDialect
- Returns:
- True if such "pooled" sequences are supported; false otherwise.
- See Also:
Dialect.getCreateSequenceStrings(String, int, int)
,Dialect.getCreateSequenceString(String, int, int)
-
getQuerySequencesString
public java.lang.String getQuerySequencesString()
Description copied from class:Dialect
Get the select command used retrieve the names of all sequences.- Overrides:
getQuerySequencesString
in classDialect
- Returns:
- The select command; or null if sequences are not supported.
- See Also:
SchemaUpdate
-
supportsLimit
public boolean supportsLimit()
Description copied from class:Dialect
Does this dialect support some form of limiting query results via a SQL clause?- Overrides:
supportsLimit
in classDialect
- Returns:
- True if this dialect supports some form of LIMIT.
-
supportsVariableLimit
public boolean supportsVariableLimit()
Description copied from class:Dialect
Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?- Overrides:
supportsVariableLimit
in classDialect
- Returns:
- True if bind variables can be used; false otherwise.
-
getLimitString
public java.lang.String getLimitString(java.lang.String sql, int offset, int limit)
Description copied from class:Dialect
Given a limit and an offset, apply the limit clause to the query.- Overrides:
getLimitString
in classDialect
- Parameters:
sql
- The query to which to apply the limit.offset
- The offset of the limitlimit
- The limit of the limit ;)- Returns:
- The modified query statement with the limit applied.
-
convertToFirstRowValue
public int convertToFirstRowValue(int zeroBasedFirstResult)
Hibernate APIs explicitly state that setFirstResult() should be a zero-based offset. Here we allow the Dialect a chance to convert that value based on what the underlying db or driver will expect. NOTE: what gets passed intoDialect.getLimitString(String,int,int)
is the zero-based offset. Dialects which do notDialect.supportsVariableLimit()
should take care to perform any needed first-row-conversion calls prior to injecting the limit values into the SQL string. DB2 does have a one-based offset, however this was actually already handled in the limit string building (the '?+1' bit). To not mess up inheritors, I'll leave that part alone and not touch the offset here.- Overrides:
convertToFirstRowValue
in classDialect
- Parameters:
zeroBasedFirstResult
- The user-supplied, zero-based first row offset.- Returns:
- The corresponding db/dialect specific offset.
- See Also:
Query.setFirstResult(int)
,Criteria.setFirstResult(int)
-
getForUpdateString
public java.lang.String getForUpdateString()
Description copied from class:Dialect
Get the string to append to SELECT statements to acquire locks for this dialect.- Overrides:
getForUpdateString
in classDialect
- Returns:
- The appropriate FOR UPDATE clause string.
-
useMaxForLimit
public boolean useMaxForLimit()
Description copied from class:Dialect
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows? This is easiest understood via an example. Consider you have a table with 20 rows, but you only want to retrieve rows number 11 through 20. Generally, a limit with offset would say that the offset = 11 and the limit = 10 (we only want 10 rows at a time); this is specifying the total number of returned rows. Some dialects require that we instead specify offset = 11 and limit = 20, where 20 is the "last" row we want relative to offset (i.e. total number of rows = 20 - 11 = 9) So essentially, is limit relative from offset? Or is limit absolute?- Overrides:
useMaxForLimit
in classDialect
- Returns:
- True if limit is relative from offset; false otherwise.
-
supportsOuterJoinForUpdate
public boolean supportsOuterJoinForUpdate()
Description copied from class:Dialect
Does this dialect support FOR UPDATE in conjunction with outer joined rows?- Overrides:
supportsOuterJoinForUpdate
in classDialect
- Returns:
- True if outer joined rows can be locked via FOR UPDATE.
-
supportsExistsInSelect
public boolean supportsExistsInSelect()
Description copied from class:Dialect
Does the dialect support an exists statement in the select clause?- Overrides:
supportsExistsInSelect
in classDialect
- Returns:
- True if exists checks are allowed in the select clause; false otherwise.
-
supportsLockTimeouts
public boolean supportsLockTimeouts()
Description copied from class:Dialect
Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.- Overrides:
supportsLockTimeouts
in classDialect
- Returns:
- True is this dialect supports specifying lock timeouts.
-
getSelectClauseNullString
public java.lang.String getSelectClauseNullString(int sqlType)
Description copied from class:Dialect
Given aTypes
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.- Overrides:
getSelectClauseNullString
in classDialect
- Parameters:
sqlType
- TheTypes
type code.- Returns:
- The appropriate select clause value fragment.
-
supportsUnionAll
public boolean supportsUnionAll()
Description copied from class:Dialect
Does this dialect support UNION ALL, which is generally a faster variant of UNION?- Overrides:
supportsUnionAll
in classDialect
- Returns:
- True if UNION ALL is supported; false otherwise.
-
registerResultSetOutParameter
public int registerResultSetOutParameter(java.sql.CallableStatement statement, int col) throws java.sql.SQLException
Description copied from class:Dialect
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet
*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.- Overrides:
registerResultSetOutParameter
in classDialect
- Parameters:
statement
- The callable statement.col
- The bind position at which to register the output param.- Returns:
- The number of (contiguous) bind positions used.
- Throws:
java.sql.SQLException
- Indicates problems registering the param.
-
getResultSet
public java.sql.ResultSet getResultSet(java.sql.CallableStatement ps) throws java.sql.SQLException
Description copied from class:Dialect
Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
, extract theResultSet
from the OUT parameter.- Overrides:
getResultSet
in classDialect
- Parameters:
ps
- The callable statement.- Returns:
- The extracted result set.
- Throws:
java.sql.SQLException
- Indicates problems extracting the result set.
-
supportsCommentOn
public boolean supportsCommentOn()
Description copied from class:Dialect
Does this dialect/database support commenting on tables, columns, etc?- Overrides:
supportsCommentOn
in classDialect
- Returns:
true
if commenting is supported
-
getDefaultMultiTableBulkIdStrategy
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
- Overrides:
getDefaultMultiTableBulkIdStrategy
in classDialect
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()
Description copied from class:Dialect
Does this dialect support a way to retrieve the database's current timestamp value?- Overrides:
supportsCurrentTimestampSelection
in classDialect
- Returns:
- True if the current timestamp can be retrieved; false otherwise.
-
getCurrentTimestampSelectString
public java.lang.String getCurrentTimestampSelectString()
Description copied from class:Dialect
Retrieve the command used to retrieve the current timestamp from the database.- Overrides:
getCurrentTimestampSelectString
in classDialect
- Returns:
- The command.
-
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()
Description copied from class:Dialect
Should the value returned byDialect.getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape syntax is being used...- Overrides:
isCurrentTimestampSelectStringCallable
in classDialect
- Returns:
- True if the
Dialect.getCurrentTimestampSelectString()
return is callable; false otherwise.
-
supportsParametersInInsertSelect
public boolean supportsParametersInInsertSelect()
Does this dialect support parameters within the SELECT clause of INSERT ... SELECT ... statements? NOTE : DB2 is know to support parameters in the SELECT clause, but only in casted form (seerequiresCastingOfParametersInSelectClause()
).- Overrides:
supportsParametersInInsertSelect
in classDialect
- Returns:
- True if this is supported; false otherwise.
-
requiresCastingOfParametersInSelectClause
public boolean 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. DB2 in fact does require that parameters appearing in the select clause be wrapped in cast() calls to tell the DB parser the type of the select value.- Overrides:
requiresCastingOfParametersInSelectClause
in classDialect
- Returns:
- True if select clause parameter must be cast()ed
-
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
Description copied from class:Dialect
Does this dialect support asking the result set its positioning information on forward only cursors. Specifically, in the case of scrolling fetches, Hibernate needs to useResultSet.isAfterLast()
andResultSet.isBeforeFirst()
. Certain drivers do not allow access to these methods for forward only cursors. NOTE : this is highly driver dependent!- Overrides:
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor
in classDialect
- Returns:
- True if methods like
ResultSet.isAfterLast()
andResultSet.isBeforeFirst()
are supported for forward only cursors; false otherwise.
-
getCrossJoinSeparator
public java.lang.String getCrossJoinSeparator()
Description copied from class:Dialect
Returns the separator to use for defining cross joins when translating HQL queries. Typically this will be either [ cross join ] or [, ] Note that the spaces are important!- Overrides:
getCrossJoinSeparator
in classDialect
- Returns:
- The cross join separator
-
supportsEmptyInList
public boolean supportsEmptyInList()
Description copied from class:Dialect
Does this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?- Overrides:
supportsEmptyInList
in classDialect
- Returns:
- True if empty in lists are supported; false otherwise.
-
supportsLobValueChangePropogation
public boolean supportsLobValueChangePropogation()
Description copied from class:Dialect
Does the dialect support propagating changes to LOB values back to the database? Talking about mutating the internal value of the locator as opposed to supplying a new locator instance... For BLOBs, the internal value might be changed by:Blob.setBinaryStream(long)
,Blob.setBytes(long, byte[])
,Blob.setBytes(long, byte[], int, int)
, orBlob.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)
, orClob.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 notDialect.supportsExpectedLobUsagePattern()
.- Overrides:
supportsLobValueChangePropogation
in classDialect
- Returns:
- True if the changes are propagated back to the database; false otherwise.
-
doesReadCommittedCauseWritersToBlockReaders
public boolean doesReadCommittedCauseWritersToBlockReaders()
Description copied from class:Dialect
For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?- Overrides:
doesReadCommittedCauseWritersToBlockReaders
in classDialect
- Returns:
- True if writers block readers to achieve READ_COMMITTED; false otherwise.
-
supportsTupleDistinctCounts
public boolean supportsTupleDistinctCounts()
Description copied from class:Dialect
Does this dialect support `count(distinct a,b)`?- Overrides:
supportsTupleDistinctCounts
in classDialect
- Returns:
- True if the database supports counting distinct tuples; false otherwise.
-
getSqlTypeDescriptorOverride
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode)
Description copied from class:Dialect
Returns theSqlTypeDescriptor
that should be used to handle the given JDBC type code. Returnsnull
if there is no override.- Overrides:
getSqlTypeDescriptorOverride
in classDialect
- Parameters:
sqlCode
- ATypes
constant indicating the SQL column type- Returns:
- The
SqlTypeDescriptor
to use as an override, ornull
if there is no override.
-
buildSQLExceptionConversionDelegate
public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
Description copied from class:Dialect
Build an instance of aSQLExceptionConversionDelegate
for interpreting dialect-specific error or SQLState codes. WhenDialect.buildSQLExceptionConverter()
returns null, the defaultSQLExceptionConverter
is used to interpret SQLState and error codes. If this method is overridden to return a non-null value, the defaultSQLExceptionConverter
will use the returnedSQLExceptionConversionDelegate
in addition to the following standard delegates:- a "static" delegate based on the JDBC 4 defined SQLException hierarchy;
- a delegate that interprets SQLState codes for either X/Open or SQL-2003 codes, depending on java.sql.DatabaseMetaData#getSQLStateType
- Overrides:
buildSQLExceptionConversionDelegate
in classDialect
- Returns:
- The SQLExceptionConversionDelegate for this dialect
-
getUniqueDelegate
public UniqueDelegate getUniqueDelegate()
Description copied from class:Dialect
Get the UniqueDelegate supported by this dialect- Overrides:
getUniqueDelegate
in classDialect
- Returns:
- The UniqueDelegate
-
getNotExpression
public java.lang.String getNotExpression(java.lang.String expression)
Description copied from class:Dialect
Negate an expression- Overrides:
getNotExpression
in classDialect
- Parameters:
expression
- The expression to negate- Returns:
- The negated expression
-
getLimitHandler
public LimitHandler getLimitHandler()
Description copied from class:Dialect
Returns the delegate managing LIMIT clause.- Overrides:
getLimitHandler
in classDialect
- Returns:
- LIMIT clause delegate.
-
renderOrderByElement
public java.lang.String renderOrderByElement(java.lang.String expression, java.lang.String collation, java.lang.String order, NullPrecedence nullPrecedence)
Handle DB2 "support" for null precedence...- Overrides:
renderOrderByElement
in classDialect
- Parameters:
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 formatcollate IDENTIFIER
, ornull
if expression has not been explicitly specified.order
- Order direction. Possible values:asc
,desc
, ornull
if expression has not been explicitly specified.nullPrecedence
- Nulls precedence. Default value:NullPrecedence.NONE
.- Returns:
-
getIdentityColumnSupport
public IdentityColumnSupport getIdentityColumnSupport()
Description copied from class:Dialect
Get the appropriateIdentityColumnSupport
- Overrides:
getIdentityColumnSupport
in classDialect
- Returns:
- the IdentityColumnSupport
-
supportsPartitionBy
public boolean supportsPartitionBy()
Description copied from class:Dialect
Does the underlying database support partition by- Overrides:
supportsPartitionBy
in classDialect
- Returns:
- boolean
-
-