Class DB2Dialect
- All Implemented Interfaces:
FunctionContributor
,TypeContributor
,ConversionContext
- Direct Known Subclasses:
DB2400Dialect
,DB2iDialect
,DB2SpatialDialect
,DB2zDialect
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hibernate.dialect.Dialect
Dialect.SizeStrategy, Dialect.SizeStrategyImpl
-
Field Summary
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, LEGACY_LOB_MERGE_STRATEGY, LOG_BASE2OF10, NEW_LOCATOR_LOB_MERGE_STRATEGY, QUOTE, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendBinaryLiteral
(SqlAppender appender, byte[] bytes) Append a binary literal to the givenSqlAppender
.void
appendBooleanValueString
(SqlAppender appender, boolean bool) Append the SQL literal expression representing the given boolean value to the givenSqlAppender
.void
appendDatetimeFormat
(SqlAppender appender, String format) Translate the given datetime format string from the pattern language defined by Java'sDateTimeFormatter
to whatever pattern language is understood by the native datetime formatting function for this database (often theto_char()
function).void
appendDateTimeLiteral
(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal representing the givenjava.time
value to the givenSqlAppender
.void
appendDateTimeLiteral
(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal representing the givenCalendar
value to the givenSqlAppender
.void
appendDateTimeLiteral
(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal representing the givenDate
value to the givenSqlAppender
.buildIdentifierHelper
(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) TheIdentifierHelper
indicated by this dialect for handling identifier conversions.An instance ofSQLExceptionConversionDelegate
for interpreting dialect-specific error or SQLState codes.boolean
Is there some way to disable foreign key constraint checking while truncating tables? (If there's no way to do it, and if we can't batch truncate, we must drop and recreate the constraints instead.)protected String
columnType
(int sqlTypeCode) void
contributeTypes
(TypeContributions typeContributions, ServiceRegistry serviceRegistry) A callback which allows theDialect
to contribute types.protected UniqueDelegate
boolean
For the underlying database, isREAD_COMMITTED
isolation implemented by forcing readers to wait for write locks to be released?boolean
Does this dialect round a temporal when converting from a precision higher to a lower one?boolean
Do we need to drop constraints before dropping tables in this dialect?extractPattern
(TemporalUnit unit) Obtain a pattern for the SQL equivalent to anextract()
function call.generatedAs
(String generatedAs) Thegenerated as
clause, or similar, for generated column declarations in DDL statements.How does this dialect support aggregate types likeSqlTypes.STRUCT
.getAlterColumnTypeString
(String columnName, String columnType, String columnDefinition) The fragment of analter table
command which modifies a column type, or null if column types cannot be modified.TheCallableStatementSupport
for this database.getCreateIndexTail
(boolean unique, List<Column> columns) A string to be appended to the end of thecreate index
command, usually to specify thatnull
values are to be considered distinct.An arbitrary extension to append to the end of the UDTcreate type
command.The command used to retrieve the current timestamp from the database.DB2 LUW Versionint
This is the default precision for a generated column of exact numeric typeDECIMAL
orNUMERIC
mapped to aBigInteger
orBigDecimal
.int
The default value to use for the configuration property "hibernate.jdbc.batch_size".getDisableConstraintStatement
(String tableName, String name) A SQL statement that temporarily disables checking of the given foreign key constraint.Get the minimumDmlTargetColumnQualifierSupport
required by this dialect.String[]
getDropSchemaCommand
(String schemaName) Get the SQL command used to drop the named schema.getEnableConstraintStatement
(String tableName, String name) A SQL statement that re-enables checking of the given foreign key constraint.getFallbackSqmInsertStrategy
(EntityMappingType rootEntityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext) TheSqmMultiTableInsertStrategy
to use when not specified byQueryEngineOptions.getCustomSqmMultiTableInsertStrategy()
.getFallbackSqmMutationStrategy
(EntityMappingType rootEntityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext) TheSqmMultiTableMutationStrategy
to use when not specified byQueryEngineOptions.getCustomSqmMultiTableMutationStrategy()
.Retrieves theFOR UPDATE SKIP LOCKED
syntax specific to this dialect.getForUpdateSkipLockedString
(String aliases) Get theFOR UPDATE OF column_list SKIP LOCKED
fragment appropriate for this dialect, given the aliases of the columns to be write locked.Get the string to append toSELECT
statements to acquire pessimistic UPGRADE locks for this dialect.long
Since we're usingseconds_between()
andadd_seconds()
, it makes sense to use seconds as the "native" precision.Get the appropriateIdentityColumnSupport
for this dialect.int
Return the limit that the underlying database places on the number of elements in anIN
predicate.Obtain aLimitHandler
that implements pagination support forQuery.setMaxResults(int)
andQuery.setFirstResult(int)
.int
What is the maximum identifier length supported by this dialect?int
The biggest size value that can be supplied as argument to aTypes.VARCHAR
-like type.protected DatabaseVersion
Get the version of the SQL dialect that is the minimum supported by this implementation.Get theselect
command used retrieve the names of all sequences.getReadLockString
(int timeout) Get the string to append toSELECT
statements to acquire READ locks for this dialect.Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
, extract theResultSet
from theOUT
parameter.getResultSet
(CallableStatement statement, int position) Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
, extract theResultSet
from the positionalOUT
parameter.getResultSet
(CallableStatement statement, String name) Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
, extract theResultSet
from the namedOUT
parameter.getSelectClauseNullString
(int sqlType, TypeConfiguration typeConfiguration) Given a JDBC type code, return the expression for a literal null value of that type, to use in aselect
clause.ASequenceInformationExtractor
which is able to extractSequenceInformation
from the JDBC result set returned whenDialect.getQuerySequencesString()
is executed.Get the appropriateSequenceSupport
for this dialect.getTruncateTableStatement
(String tableName) A SQL statement that truncates the given table.Get theUniqueDelegate
supported by this dialectAViolatedConstraintNameExtractor
for extracting the name of a violated constraint from aSQLException
.getWriteLockString
(int timeout) Get the string to append toSELECT
statements to acquire pessimistic WRITE locks for this dialect.void
initializeFunctionRegistry
(FunctionContributions functionContributions) Initialize the given registry with any dialect-specific functions.boolean
Is the command returned byDialect.getCurrentTimestampSelectString()
treated as callable?protected void
registerColumnTypes
(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Register ANSI-standard column types using the length limits defined byDialect.getMaxVarcharLength()
,Dialect.getMaxNVarcharLength()
, andDialect.getMaxVarbinaryLength()
.protected void
Register the reserved words of ANSI-standard SQL as keywords.int
registerResultSetOutParameter
(CallableStatement statement, int col) Registers a parameter capable of returning aResultSet
by position, either anOUT
parameter, or aREF_CURSOR
parameter as defined in Java 8.int
registerResultSetOutParameter
(CallableStatement statement, String name) Registers a parameter capable of returning aResultSet
by name, either anOUT
parameter, or aREF_CURSOR
parameter as defined in Java 8.boolean
Does this dialect/database require casting of non-string arguments in theconcat()
function?The more "standard" syntax isrid_bit(alias)
but here we usealias.rowid
.int
The JDBC type code of therowid
-like pseudo-column which acts as a high-performance row locator.static String
selectNullString
(int sqlType) boolean
Does this dialect support modifying the type of an existing column?boolean
Does this dialect support commenting on tables and columns?boolean
Does this dialect support some way to retrieve the current timestamp value from the database?boolean
Does this dialect support some kind ofdistinct from
predicate?boolean
Does the dialect support an exists statement in the select clause?boolean
Does this dialect support thefrom
clause for update statements?boolean
For dropping a table, can the phraseif exists
be applied before the table name?boolean
Does this dialect fully support returning arbitrary generated column values after execution of aninsert
statement, using native SQL syntax?boolean
Does this dialect supports returning theRowId
column after execution of aninsert
statement, using native SQL syntax?boolean
Does this dialect support theis true
andis false
operators?boolean
Does this dialect support the SQLlateral
keyword or a proprietary alternative?boolean
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
Does this dialect support specifying timeouts when requesting locks.boolean
Does this dialect support insert, update, and delete statements with Common Table Expressions (CTEs)?boolean
Does this dialect supportnulls first
andnulls last
?boolean
Does this dialect supportoffset
in subqueries?boolean
Does this dialect supportFOR UPDATE
in conjunction with outer-joined rows?boolean
Does is dialect supportpartition by
?protected boolean
Whether a predicate likea > 0
can appear in an expression context, for example, in aselect
list item.boolean
Does this dialect/database support recursive CTEs?Whether this Dialect supports the JDBCTypes.REF_CURSOR
type.boolean
Does this dialect support asking the result set its positioning information on forward-only cursors?boolean
Does this dialect supportSKIP_LOCKED
timeout.boolean
Does this dialect supportcount(distinct a,b)
?boolean
Does this dialect supportvalues
lists of formVALUES (1), (2), (3)
?boolean
Does this dialect support window functions likerow_number() over (..)
?timestampaddPattern
(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) Obtain a pattern for the SQL equivalent to atimestampadd()
function call.timestampdiffPattern
(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType) Obtain a pattern for the SQL equivalent to atimestampdiff()
function call.static String
timestampdiffPatternV10
(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType) Return the name used to identify the given field as an argument to theextract()
function, or of this dialect's equivalent function.Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendArrayLiteral, appendIntervalLiteral, appendLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, canBatchTruncate, canCreateCatalog, canCreateSchema, castPattern, castType, checkVersion, closeQuote, contribute, contributeFunctions, createOptionalTableUpdateOperation, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, defaultScrollMode, doesRepeatableReadCauseReadersToBlockWriters, equivalentTypes, escapeComment, forceLobAsLastValue, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCascadeConstraintsString, getCaseInsensitiveLike, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getCurrentSchemaCommand, getDefaultIntervalSecondScale, getDefaultLobLength, getDefaultNonContextualLobCreation, getDefaultProperties, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintsStatement, getDoublePrecision, getDropCatalogCommand, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropForeignKeyString, getDropTableString, getDropUniqueKeyString, getEnableConstraintsStatement, getEnumTypeDeclaration, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFloatPrecision, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctionalDependencyAnalysisSupport, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIndexExporter, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarbinaryLength, getMaxVarcharCapacity, getMultiKeyLoadSizingStrategy, getNameQualifierSupport, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getNullOrdering, getParameterCountLimit, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getQueryHintString, getReadLockString, getReadRowLockStrategy, getRowIdColumnString, getSchemaNameResolver, getSelectGUIDString, getSequenceExporter, getSizeStrategy, getSqmTranslatorFactory, getSupportedTemporaryTableKind, getTableCleaner, getTableComment, getTableExporter, getTableMigrator, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTimeZoneSupport, getTruncateTableStatements, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, getWriteLockString, getWriteRowLockStrategy, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, inlineLiteral, isAnsiNullOn, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, isLockTimeoutParameterized, openQuote, ordinal, prependComment, qualifyIndexName, quote, quoteCollation, registerKeyword, registerKeywords, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeDescriptor, resolveSqlTypeLength, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsConflictClauseForInsertCTE, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFractionalTimestampArithmetic, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTypeName, supportsInsertReturningGeneratedKeys, supportsJdbcConnectionLobCreation, supportsMaterializedLobAccess, supportsNamedParameters, supportsNationalizedMethods, supportsNoColumnsInsert, supportsNoWait, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsParametersInInsertSelect, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUpdateReturning, supportsValuesListForInsert, supportsWait, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, trimPattern, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useConnectionToCreateLob, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob, useMaterializedLobWhenCapacityExceeded
-
Constructor Details
-
DB2Dialect
public DB2Dialect() -
DB2Dialect
-
DB2Dialect
-
-
Method Details
-
getMinimumSupportedVersion
Description copied from class:Dialect
Get the version of the SQL dialect that is the minimum supported by this implementation.- Overrides:
getMinimumSupportedVersion
in classDialect
-
registerDefaultKeywords
protected void registerDefaultKeywords()Description copied from class:Dialect
Register the reserved words of ANSI-standard SQL as keywords.- Overrides:
registerDefaultKeywords
in classDialect
- See Also:
-
getDB2Version
DB2 LUW Version -
getDefaultStatementBatchSize
public int getDefaultStatementBatchSize()Description copied from class:Dialect
The default value to use for the configuration property "hibernate.jdbc.batch_size".- Overrides:
getDefaultStatementBatchSize
in classDialect
-
columnType
Description copied from class:Dialect
The database column type name for a given JDBC type code defined inTypes
orSqlTypes
. This default implementation returns the ANSI-standard type name.This method may be overridden by concrete
Dialect
s as an alternative toDialect.registerColumnTypes(TypeContributions, ServiceRegistry)
for simple registrations.Note that:
- Implementations of this method are expected to define a
sensible mapping for
Types.NCLOB
Types.NCHAR
, andTypes.NVARCHAR
. On some database, these types are simply remapped toCLOB
,CHAR
, andVARCHAR
. - Mappings for
Types.TIMESTAMP
andTypes.TIMESTAMP_WITH_TIMEZONE
should support explicit specification of precision if possible. - As specified by
DdlTypeRegistry.getDescriptor(int)
, this method never receivesTypes.LONGVARCHAR
,Types.LONGNVARCHAR
, norTypes.LONGVARBINARY
, which are considered synonyms for their non-LONG
counterparts. - On the other hand, the types
SqlTypes.LONG32VARCHAR
,SqlTypes.LONG32NVARCHAR
, andSqlTypes.LONG32VARBINARY
are not synonyms, and implementations of this method must define sensible mappings, for example to database-nativeTEXT
orCLOB
types.
- Overrides:
columnType
in classDialect
- Parameters:
sqlTypeCode
- a SQLtype code
- Returns:
- a column type name, with
$l
,$p
,$s
placeholders for length, precision, scale - See Also:
- Implementations of this method are expected to define a
sensible mapping for
-
registerColumnTypes
protected void registerColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Description copied from class:Dialect
Register ANSI-standard column types using the length limits defined byDialect.getMaxVarcharLength()
,Dialect.getMaxNVarcharLength()
, andDialect.getMaxVarbinaryLength()
.This method is always called when a
Dialect
is instantiated.- Overrides:
registerColumnTypes
in classDialect
-
createUniqueDelegate
-
getMaxVarcharLength
public int getMaxVarcharLength()Description copied from class:Dialect
The biggest size value that can be supplied as argument to aTypes.VARCHAR
-like type.For longer column lengths, use some sort of
text
-like type for the column.- Overrides:
getMaxVarcharLength
in classDialect
-
getDefaultDecimalPrecision
public int getDefaultDecimalPrecision()Description copied from class:Dialect
This is the default precision for a generated column of exact numeric typeDECIMAL
orNUMERIC
mapped to aBigInteger
orBigDecimal
.Usually returns the maximum precision of the database, except when there is no such maximum precision, or the maximum precision is very high.
- Overrides:
getDefaultDecimalPrecision
in classDialect
- Returns:
- the default precision, in decimal digits
- See Also:
-
supportsPredicateAsExpression
protected boolean supportsPredicateAsExpression()Description copied from class:Dialect
Whether a predicate likea > 0
can appear in an expression context, for example, in aselect
list item.- Overrides:
supportsPredicateAsExpression
in classDialect
-
supportsDistinctFromPredicate
public boolean supportsDistinctFromPredicate()Description copied from class:Dialect
Does this dialect support some kind ofdistinct from
predicate?That is, does it support syntax like:
... where FIRST_NAME IS DISTINCT FROM LAST_NAME
- Overrides:
supportsDistinctFromPredicate
in classDialect
- Returns:
- True if this SQL dialect is known to support some kind of
distinct from
predicate; false otherwise
-
initializeFunctionRegistry
Description copied from class:Dialect
Initialize the given registry with any dialect-specific functions.Support for certain SQL functions is required, and if the database does not support a required function, then the dialect must define a way to emulate it.
These required functions include the functions defined by the JPA query language specification:
-
avg(arg)
- aggregate function -
count([distinct ]arg)
- aggregate function -
max(arg)
- aggregate function -
min(arg)
- aggregate function -
sum(arg)
- aggregate function
-
coalesce(arg0, arg1, ...)
-
nullif(arg0, arg1)
-
lower(arg)
-
upper(arg)
-
length(arg)
-
concat(arg0, arg1, ...)
-
locate(pattern, string[, start])
-
substring(string, start[, length])
-
trim([[spec ][character ]from] string)
-
abs(arg)
-
mod(arg0, arg1)
-
sqrt(arg)
-
current date
-
current time
-
current timestamp
-
any(arg)
- aggregate function -
every(arg)
- aggregate function
-
var_samp(arg)
- aggregate function -
var_pop(arg)
- aggregate function -
stddev_samp(arg)
- aggregate function -
stddev_pop(arg)
- aggregate function
-
cast(arg as Type)
-
extract(field from arg)
-
ln(arg)
-
exp(arg)
-
power(arg0, arg1)
-
floor(arg)
-
ceiling(arg)
-
position(pattern in string)
-
substring(string from start[ for length])
-
overlay(string placing replacement from start[ for length])
java.time
types:-
local date
-
local time
-
local datetime
-
offset datetime
-
instant
-
left(string, length)
-
right(string, length)
-
replace(string, pattern, replacement)
-
pad(string with length spec[ character])
-
repeat(string, times)
-
pi
-
log10(arg)
-
log(base, arg)
-
sign(arg)
-
sin(arg)
-
cos(arg)
-
tan(arg)
-
asin(arg)
-
acos(arg)
-
atan(arg)
-
atan2(arg0, arg1)
-
round(arg0[, arg1])
-
truncate(arg0[, arg1])
-
sinh(arg)
-
tanh(arg)
-
cosh(arg)
-
least(arg0, arg1, ...)
-
greatest(arg0, arg1, ...)
-
degrees(arg)
-
radians(arg)
-
bitand(arg1, arg1)
-
bitor(arg1, arg1)
-
bitxor(arg1, arg1)
-
format(datetime as pattern)
-
collate(string as collation)
-
str(arg)
- synonym ofcast(a as String)
-
ifnull(arg0, arg1)
- synonym ofcoalesce(a, b)
extract()
, and desugared by the parser:-
second(arg)
- synonym ofextract(second from a)
-
minute(arg)
- synonym ofextract(minute from a)
-
hour(arg)
- synonym ofextract(hour from a)
-
day(arg)
- synonym ofextract(day from a)
-
month(arg)
- synonym ofextract(month from a)
-
year(arg)
- synonym ofextract(year from a)
second()
function returns a floating point value, contrary to the integer type returned by the native function with this name on many databases. Thus, we don't just naively map these HQL functions to the native SQL functions with the same names.- Overrides:
initializeFunctionRegistry
in classDialect
-
-
getDropSchemaCommand
Description copied from class:Dialect
Get the SQL command used to drop the named schema.- Overrides:
getDropSchemaCommand
in classDialect
- Parameters:
schemaName
- The name of the schema to be dropped.- Returns:
- The drop commands
-
getFractionalSecondPrecisionInNanos
public long getFractionalSecondPrecisionInNanos()Since we're usingseconds_between()
andadd_seconds()
, it makes sense to use seconds as the "native" precision.- Overrides:
getFractionalSecondPrecisionInNanos
in classDialect
- Returns:
- the precision, specified as a quantity of nanoseconds
- See Also:
-
timestampdiffPattern
public String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType) Description copied from class:Dialect
Obtain a pattern for the SQL equivalent to atimestampdiff()
function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.- Overrides:
timestampdiffPattern
in classDialect
- Parameters:
unit
- the first argumentfromTemporalType
- true if the first argument is a timestamp, false if a datetoTemporalType
- true if the second argument is
-
timestampdiffPatternV10
public static String timestampdiffPatternV10(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType) -
timestampaddPattern
public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) Description copied from class:Dialect
Obtain a pattern for the SQL equivalent to atimestampadd()
function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.- Overrides:
timestampaddPattern
in classDialect
- Parameters:
unit
- The unit to add to the temporaltemporalType
- The type of the temporalintervalType
- The type of interval to add or null if it's not a native interval
-
appendDateTimeLiteral
public void appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone) Description copied from class:Dialect
Append a datetime literal representing the givenjava.time
value to the givenSqlAppender
.- Overrides:
appendDateTimeLiteral
in classDialect
-
appendDateTimeLiteral
public void appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone) Description copied from class:Dialect
Append a datetime literal representing the givenDate
value to the givenSqlAppender
.- Overrides:
appendDateTimeLiteral
in classDialect
-
appendDateTimeLiteral
public void appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone) Description copied from class:Dialect
Append a datetime literal representing the givenCalendar
value to the givenSqlAppender
.- Overrides:
appendDateTimeLiteral
in classDialect
-
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.
-
getCreateIndexTail
Description copied from class:Dialect
A string to be appended to the end of thecreate index
command, usually to specify thatnull
values are to be considered distinct.- Overrides:
getCreateIndexTail
in classDialect
-
getSequenceSupport
Description copied from class:Dialect
Get the appropriateSequenceSupport
for this dialect.- Overrides:
getSequenceSupport
in classDialect
-
getQuerySequencesString
Description copied from class:Dialect
Get theselect
command used retrieve the names of all sequences.- Overrides:
getQuerySequencesString
in classDialect
- Returns:
- The select command; or null if sequences are not supported.
-
getSequenceInformationExtractor
Description copied from class:Dialect
ASequenceInformationExtractor
which is able to extractSequenceInformation
from the JDBC result set returned whenDialect.getQuerySequencesString()
is executed.- Overrides:
getSequenceInformationExtractor
in classDialect
-
getForUpdateString
Description copied from class:Dialect
Get the string to append toSELECT
statements to acquire pessimistic UPGRADE locks for this dialect.- Overrides:
getForUpdateString
in classDialect
- Returns:
- The appropriate
FOR UPDATE
clause string.
-
supportsSkipLocked
public boolean supportsSkipLocked()Description copied from class:Dialect
Does this dialect supportSKIP_LOCKED
timeout.- Overrides:
supportsSkipLocked
in classDialect
- Returns:
true
if SKIP_LOCKED is supported
-
getForUpdateSkipLockedString
Description copied from class:Dialect
Retrieves theFOR UPDATE SKIP LOCKED
syntax specific to this dialect.- Overrides:
getForUpdateSkipLockedString
in classDialect
- Returns:
- The appropriate
FOR UPDATE SKIP LOCKED
clause string.
-
getForUpdateSkipLockedString
Description copied from class:Dialect
Get theFOR UPDATE OF column_list SKIP LOCKED
fragment appropriate for this dialect, given the aliases of the columns to be write locked.- Overrides:
getForUpdateSkipLockedString
in classDialect
- Parameters:
aliases
- The columns to be write locked.- Returns:
- The appropriate
FOR UPDATE colunm_list SKIP LOCKED
clause string.
-
getWriteLockString
Description copied from class:Dialect
Get the string to append toSELECT
statements to acquire pessimistic WRITE locks for this dialect.Location of the returned string is treated the same as
Dialect.getForUpdateString()
.- Overrides:
getWriteLockString
in classDialect
- Parameters:
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCK
clause string.
-
getReadLockString
Description copied from class:Dialect
Get the string to append toSELECT
statements to acquire READ locks for this dialect.Location of the returned string is treated the same as
Dialect.getForUpdateString()
.- Overrides:
getReadLockString
in classDialect
- Parameters:
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCK
clause string.
-
supportsOuterJoinForUpdate
public boolean supportsOuterJoinForUpdate()Description copied from class:Dialect
Does this dialect supportFOR 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
Does this dialect support specifying timeouts when requesting locks.- Overrides:
supportsLockTimeouts
in classDialect
- Returns:
- True is this dialect supports specifying lock timeouts.
-
requiresCastForConcatenatingNonStrings
public boolean requiresCastForConcatenatingNonStrings()Description copied from class:Dialect
Does this dialect/database require casting of non-string arguments in theconcat()
function?- Overrides:
requiresCastForConcatenatingNonStrings
in classDialect
- Returns:
true
if casting usingcast()
is required
-
getSelectClauseNullString
Description copied from class:Dialect
Given a JDBC type code, return the expression for a literal null value of that type, to use in aselect
clause.The
select
query will be an element of aUNION
orUNION ALL
.- Overrides:
getSelectClauseNullString
in classDialect
- Parameters:
sqlType
- TheTypes
type code.typeConfiguration
- The type configuration- Returns:
- The appropriate select clause value fragment.
-
selectNullString
-
supportsRefCursors
Description copied from class:Dialect
Whether this Dialect supports the JDBCTypes.REF_CURSOR
type.- Overrides:
supportsRefCursors
in classDialect
- Returns:
true
indicates it does;false
indicates it does not;null
indicates it might and that database-metadata should be consulted- See Also:
-
registerResultSetOutParameter
Description copied from class:Dialect
Registers a parameter capable of returning aResultSet
by position, either anOUT
parameter, or aREF_CURSOR
parameter as defined in Java 8.- 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:
SQLException
- Indicates problems registering the param.
-
registerResultSetOutParameter
public int registerResultSetOutParameter(CallableStatement statement, String name) throws SQLException Description copied from class:Dialect
Registers a parameter capable of returning aResultSet
by name, either anOUT
parameter, or aREF_CURSOR
parameter as defined in Java 8.- Overrides:
registerResultSetOutParameter
in classDialect
- Parameters:
statement
- The callable statement.name
- The parameter name (for drivers which support named parameters).- Returns:
- The number of (contiguous) bind positions used.
- Throws:
SQLException
- Indicates problems registering the param.
-
getResultSet
Description copied from class:Dialect
Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
, extract theResultSet
from theOUT
parameter.- Overrides:
getResultSet
in classDialect
- Parameters:
ps
- The callable statement.- Returns:
- The extracted result set.
- Throws:
SQLException
- Indicates problems extracting the result set.
-
getResultSet
Description copied from class:Dialect
Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
, extract theResultSet
from the positionalOUT
parameter.- Overrides:
getResultSet
in classDialect
- Parameters:
statement
- The callable statement.position
- The bind position at which to register the output param.- Returns:
- The extracted result set.
- Throws:
SQLException
- Indicates problems extracting the result set.
-
getResultSet
Description copied from class:Dialect
Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int)
, extract theResultSet
from the namedOUT
parameter.- Overrides:
getResultSet
in classDialect
- Parameters:
statement
- The callable statement.name
- The parameter name (for drivers which support named parameters).- Returns:
- The extracted result set.
- Throws:
SQLException
- Indicates problems extracting the result set.
-
supportsCommentOn
public boolean supportsCommentOn()Description copied from class:Dialect
Does this dialect support commenting on tables and columns?- Overrides:
supportsCommentOn
in classDialect
- Returns:
true
if commenting is supported
-
getAlterColumnTypeString
public String getAlterColumnTypeString(String columnName, String columnType, String columnDefinition) Description copied from class:Dialect
The fragment of analter table
command which modifies a column type, or null if column types cannot be modified. Oftenalter column col_name set data type col_type
.- Overrides:
getAlterColumnTypeString
in classDialect
- Parameters:
columnName
- the name of the columncolumnType
- the new type of the columncolumnDefinition
- the full column definition- Returns:
- a fragment to be appended to
alter table
-
supportsAlterColumnType
public boolean supportsAlterColumnType()Description copied from class:Dialect
Does this dialect support modifying the type of an existing column?- Overrides:
supportsAlterColumnType
in classDialect
-
supportsIfExistsBeforeTableName
public boolean supportsIfExistsBeforeTableName()Description copied from class:Dialect
For dropping a table, can the phraseif exists
be applied before the table name?- Overrides:
supportsIfExistsBeforeTableName
in classDialect
- Returns:
true
ifif exists
can be applied before the table name
-
getFallbackSqmMutationStrategy
public SqmMultiTableMutationStrategy getFallbackSqmMutationStrategy(EntityMappingType rootEntityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext) Description copied from class:Dialect
TheSqmMultiTableMutationStrategy
to use when not specified byQueryEngineOptions.getCustomSqmMultiTableMutationStrategy()
. -
getFallbackSqmInsertStrategy
public SqmMultiTableInsertStrategy getFallbackSqmInsertStrategy(EntityMappingType rootEntityDescriptor, RuntimeModelCreationContext runtimeModelCreationContext) Description copied from class:Dialect
TheSqmMultiTableInsertStrategy
to use when not specified byQueryEngineOptions.getCustomSqmMultiTableInsertStrategy()
. -
supportsIsTrue
public boolean supportsIsTrue()Description copied from class:Dialect
Does this dialect support theis true
andis false
operators?- Overrides:
supportsIsTrue
in classDialect
- Returns:
true
if the database supportsis true
andis false
, orfalse
if it does not. The default isis false
.
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()Description copied from class:Dialect
Does this dialect support some way to retrieve the current timestamp value from the database?- Overrides:
supportsCurrentTimestampSelection
in classDialect
- Returns:
- True if the current timestamp can be retrieved; false otherwise.
-
getCurrentTimestampSelectString
Description copied from class:Dialect
The command used to retrieve the current timestamp from the database.- Overrides:
getCurrentTimestampSelectString
in classDialect
-
doesRoundTemporalOnOverflow
public boolean doesRoundTemporalOnOverflow()Description copied from class:Dialect
Does this dialect round a temporal when converting from a precision higher to a lower one?- Overrides:
doesRoundTemporalOnOverflow
in classDialect
- Returns:
- true if rounding is applied, false if truncation is applied
-
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()Description copied from class:Dialect
Is the command returned byDialect.getCurrentTimestampSelectString()
treated as callable?Typically, this indicates the use of the JDBC escape syntax.
- Overrides:
isCurrentTimestampSelectStringCallable
in classDialect
- Returns:
- if the
Dialect.getCurrentTimestampSelectString()
is treated as callable; false otherwise.
-
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 use
ResultSet.isAfterLast()
andResultSet.isBeforeFirst()
. Certain drivers do not allow access to these methods for forward-only cursors.- Overrides:
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor
in classDialect
- Returns:
- True if methods like
ResultSet.isAfterLast()
andResultSet.isBeforeFirst()
are supported for forward only cursors; false otherwise.
-
supportsLobValueChangePropagation
public boolean supportsLobValueChangePropagation()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)
.
- Overrides:
supportsLobValueChangePropagation
in classDialect
- Returns:
- True if the changes are propagated back to the database; false otherwise.
- For BLOBs, the internal value might be changed by:
-
doesReadCommittedCauseWritersToBlockReaders
public boolean doesReadCommittedCauseWritersToBlockReaders()Description copied from class:Dialect
For the underlying database, isREAD_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 supportcount(distinct a,b)
?- Overrides:
supportsTupleDistinctCounts
in classDialect
- Returns:
- True if the database supports counting distinct tuples; false otherwise.
-
contributeTypes
Description copied from class:Dialect
A callback which allows theDialect
to contribute types.- Overrides:
contributeTypes
in classDialect
- Parameters:
typeContributions
- Callback to contribute the typesserviceRegistry
- The service registry
-
getAggregateSupport
Description copied from class:Dialect
How does this dialect support aggregate types likeSqlTypes.STRUCT
.- Overrides:
getAggregateSupport
in classDialect
-
getCallableStatementSupport
Description copied from class:Dialect
TheCallableStatementSupport
for this database. Does this database support returning cursors?- Overrides:
getCallableStatementSupport
in classDialect
-
appendBinaryLiteral
Description copied from class:Dialect
Append a binary literal to the givenSqlAppender
.- Overrides:
appendBinaryLiteral
in classDialect
-
getViolatedConstraintNameExtractor
Description copied from class:Dialect
AViolatedConstraintNameExtractor
for extracting the name of a violated constraint from aSQLException
.- Specified by:
getViolatedConstraintNameExtractor
in interfaceConversionContext
- Overrides:
getViolatedConstraintNameExtractor
in classDialect
-
buildSQLExceptionConversionDelegate
Description copied from class:Dialect
An instance ofSQLExceptionConversionDelegate
for interpreting dialect-specific error or SQLState codes.If this method is overridden to return a non-null value, the default
SQLExceptionConverter
will use the returnedSQLExceptionConversionDelegate
in addition to the following standard delegates:- a "static" delegate based on the JDBC4-defined
SQLException
hierarchy, and - a delegate that interprets SQLState codes as either X/Open or SQL-2003 codes, depending on what is reported by the JDBC driver.
It is strongly recommended that every
Dialect
implementation override this method, since interpretation of a SQL error is much more accurate when based on the vendor-specific error code, rather than on the SQLState.- Overrides:
buildSQLExceptionConversionDelegate
in classDialect
- Returns:
- The
SQLExceptionConversionDelegate
for this dialect
- a "static" delegate based on the JDBC4-defined
-
getUniqueDelegate
Description copied from class:Dialect
Get theUniqueDelegate
supported by this dialect- Overrides:
getUniqueDelegate
in classDialect
- Returns:
- The UniqueDelegate
-
getMaxIdentifierLength
public int getMaxIdentifierLength()Description copied from class:Dialect
What is the maximum identifier length supported by this dialect?- Overrides:
getMaxIdentifierLength
in classDialect
- Returns:
- The maximum length.
-
getLimitHandler
Description copied from class:Dialect
Obtain aLimitHandler
that implements pagination support forQuery.setMaxResults(int)
andQuery.setFirstResult(int)
.- Overrides:
getLimitHandler
in classDialect
-
supportsNullPrecedence
public boolean supportsNullPrecedence()Description copied from class:Dialect
Does this dialect supportnulls first
andnulls last
?- Overrides:
supportsNullPrecedence
in classDialect
-
getSqlAstTranslatorFactory
Description copied from class:Dialect
- Overrides:
getSqlAstTranslatorFactory
in classDialect
- See Also:
-
getIdentityColumnSupport
Description copied from class:Dialect
Get the appropriateIdentityColumnSupport
for this dialect.- Overrides:
getIdentityColumnSupport
in classDialect
- Returns:
- the IdentityColumnSupport
-
supportsInsertReturning
public boolean supportsInsertReturning()Description copied from class:Dialect
Does this dialect fully support returning arbitrary generated column values after execution of aninsert
statement, using native SQL syntax?Support for identity columns is insufficient here, we require something like:
insert ... returning ...
select from final table (insert ... )
- Overrides:
supportsInsertReturning
in classDialect
- Returns:
true
because we can useselect ... from new table (insert .... )
- See Also:
-
supportsInsertReturningRowId
public boolean supportsInsertReturningRowId()Description copied from class:Dialect
Does this dialect supports returning theRowId
column after execution of aninsert
statement, using native SQL syntax?- Overrides:
supportsInsertReturningRowId
in classDialect
- Returns:
true
is the dialect supports returning the rowid column- See Also:
-
supportsValuesList
public boolean supportsValuesList()Description copied from class:Dialect
Does this dialect supportvalues
lists of formVALUES (1), (2), (3)
?- Overrides:
supportsValuesList
in classDialect
- Returns:
true
ifvalues
list are supported
-
supportsPartitionBy
public boolean supportsPartitionBy()Description copied from class:Dialect
Does is dialect supportpartition by
?- Overrides:
supportsPartitionBy
in classDialect
-
supportsNonQueryWithCTE
public boolean supportsNonQueryWithCTE()Description copied from class:Dialect
Does this dialect support insert, update, and delete statements with Common Table Expressions (CTEs)?- Overrides:
supportsNonQueryWithCTE
in classDialect
- Returns:
true
if non-query statements are supported with CTE
-
supportsRecursiveCTE
public boolean supportsRecursiveCTE()Description copied from class:Dialect
Does this dialect/database support recursive CTEs?- Overrides:
supportsRecursiveCTE
in classDialect
- Returns:
true
if recursive CTEs are supported
-
supportsOffsetInSubquery
public boolean supportsOffsetInSubquery()Description copied from class:Dialect
Does this dialect supportoffset
in subqueries?For example:
select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1 offset 1)
- Overrides:
supportsOffsetInSubquery
in classDialect
- Returns:
true
if it does
-
supportsWindowFunctions
public boolean supportsWindowFunctions()Description copied from class:Dialect
Does this dialect support window functions likerow_number() over (..)
?- Overrides:
supportsWindowFunctions
in classDialect
- Returns:
true
if the underlying database supports window functions,false
otherwise. The default isfalse
.
-
supportsLateral
public boolean supportsLateral()Description copied from class:Dialect
Does this dialect support the SQLlateral
keyword or a proprietary alternative?- Overrides:
supportsLateral
in classDialect
- Returns:
true
if the underlying database supports lateral,false
otherwise. The default isfalse
.
-
appendDatetimeFormat
Description copied from class:Dialect
Translate the given datetime format string from the pattern language defined by Java'sDateTimeFormatter
to whatever pattern language is understood by the native datetime formatting function for this database (often theto_char()
function).Since it's never possible to translate every pattern letter sequences understood by
DateTimeFormatter
, only the following subset of pattern letters is accepted by Hibernate:- G: era
- y: year of era
- Y: year of week-based year
- M: month of year
- w: week of week-based year (ISO week number)
- W: week of month
- E: day of week (name)
- e: day of week (number)
- d: day of month
- D: day of year
- a: AM/PM
- H: hour of day (24 hour time)
- h: hour of AM/PM (12 hour time)
- m: minutes
- s: seconds
- z,Z,x: timezone offset
In addition, punctuation characters and single-quoted literal strings are accepted.
Appends a pattern accepted by the function that formats dates and times in this dialect to a SQL fragment that is being constructed.
- Overrides:
appendDatetimeFormat
in classDialect
-
translateExtractField
Description copied from class:Dialect
Return the name used to identify the given field as an argument to theextract()
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
, norTemporalUnit.WEEK_OF_MONTH
, which are already desugared byExtractFunction
.- Overrides:
translateExtractField
in classDialect
-
appendBooleanValueString
Description copied from class:Dialect
Append the SQL literal expression representing the given boolean value to the givenSqlAppender
.- Overrides:
appendBooleanValueString
in classDialect
- Parameters:
appender
- TheSqlAppender
to append the literal expression tobool
- The boolean value
-
extractPattern
Description copied from class:Dialect
Obtain a pattern for the SQL equivalent to anextract()
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
, orTemporalUnit.WEEK_OF_MONTH
, which are already desugared byExtractFunction
.- Overrides:
extractPattern
in classDialect
- Parameters:
unit
- the first argument
-
getInExpressionCountLimit
public int getInExpressionCountLimit()Description copied from class:Dialect
Return the limit that the underlying database places on the number of elements in anIN
predicate. If the database defines no such limits, simply return zero or a number smaller than zero.- Overrides:
getInExpressionCountLimit
in classDialect
- Returns:
- The limit, or a non-positive integer to indicate no limit.
-
generatedAs
Description copied from class:Dialect
Thegenerated as
clause, or similar, for generated column declarations in DDL statements.- Overrides:
generatedAs
in classDialect
- Parameters:
generatedAs
- a SQL expression used to generate the column value- Returns:
- The
generated as
clause containing the given expression
-
buildIdentifierHelper
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException Description copied from class:Dialect
TheIdentifierHelper
indicated by this dialect for handling identifier conversions. Returningnull
is allowed and indicates that Hibernate should fall back 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 MIXED
By default, Hibernate will do the following:
- Call
IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
- Call
IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
- Applies
AnsiSqlKeywords.sql2003()
as reserved words - Applies the {#link #sqlKeywords} collected here as reserved words
- Applies the Dialect's
NameQualifierSupport
, if it defines one
- Overrides:
buildIdentifierHelper
in classDialect
- Parameters:
builder
- A partially-configuredIdentifierHelperBuilder
.dbMetaData
- Access to the metadata returned from the driver if needed and if available. WARNING: it may benull
.- Returns:
- The
IdentifierHelper
instance to use, ornull
to indicate Hibernate should use its fallback path - Throws:
SQLException
- Accessing theDatabaseMetaData
can throw it. Just rethrow and Hibernate will handle it.- See Also:
-
canDisableConstraints
public boolean canDisableConstraints()Description copied from class:Dialect
Is there some way to disable foreign key constraint checking while truncating tables? (If there's no way to do it, and if we can't batch truncate, we must drop and recreate the constraints instead.)- Overrides:
canDisableConstraints
in classDialect
- Returns:
true
if there is some way to do it- See Also:
-
getDisableConstraintStatement
Description copied from class:Dialect
A SQL statement that temporarily disables checking of the given foreign key constraint.- Overrides:
getDisableConstraintStatement
in classDialect
- Parameters:
tableName
- the name of the tablename
- the name of the constraint
-
getEnableConstraintStatement
Description copied from class:Dialect
A SQL statement that re-enables checking of the given foreign key constraint.- Overrides:
getEnableConstraintStatement
in classDialect
- Parameters:
tableName
- the name of the tablename
- the name of the constraint
-
getTruncateTableStatement
Description copied from class:Dialect
A SQL statement that truncates the given table.- Overrides:
getTruncateTableStatement
in classDialect
- Parameters:
tableName
- the name of the table
-
getCreateUserDefinedTypeExtensionsString
Description copied from class:Dialect
An arbitrary extension to append to the end of the UDTcreate type
command.- Overrides:
getCreateUserDefinedTypeExtensionsString
in classDialect
-
rowId
The more "standard" syntax isrid_bit(alias)
but here we usealias.rowid
.There is also an alternative
rid()
of typebigint
, but it cannot be used with partitioning.- Overrides:
rowId
in classDialect
- Parameters:
rowId
- the name specified byRowId.value()
, which is ignored ifDialect.getRowIdColumnString(java.lang.String)
is not overridden
-
rowIdSqlType
public int rowIdSqlType()Description copied from class:Dialect
The JDBC type code of therowid
-like pseudo-column which acts as a high-performance row locator.- Overrides:
rowIdSqlType
in classDialect
- Returns:
Types.ROWID
by default
-
getDmlTargetColumnQualifierSupport
Description copied from class:Dialect
Get the minimumDmlTargetColumnQualifierSupport
required by this dialect.- Overrides:
getDmlTargetColumnQualifierSupport
in classDialect
- Returns:
- the column qualifier support required by this dialect
-
supportsFromClauseInUpdate
public boolean supportsFromClauseInUpdate()Description copied from class:Dialect
Does this dialect support thefrom
clause for update statements?- Overrides:
supportsFromClauseInUpdate
in classDialect
- Returns:
true
iffrom
clause is supported
-