Package org.hibernate.dialect
Class DB2zDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.DB2Dialect
-
- org.hibernate.dialect.DB2zDialect
-
- All Implemented Interfaces:
ConversionContext
public class DB2zDialect extends DB2Dialect
An SQL dialect for DB2 for z/OS, previously known as known as Db2 UDB for z/OS and Db2 UDB for z/OS and OS/390.
-
-
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_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description DB2zDialect()
DB2zDialect(DatabaseVersion version)
DB2zDialect(DialectResolutionInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
columnType(int sqlTypeCode)
DatabaseVersion
getDB2Version()
DB2 LUW VersionIdentityColumnSupport
getIdentityColumnSupport()
Get the appropriateIdentityColumnSupport
LimitHandler
getLimitHandler()
Returns aLimitHandler
that implements support forQuery.setMaxResults(int)
andQuery.setFirstResult(int)
for this dialect.String
getQuerySequencesString()
Get the select command used retrieve the names of all sequences.SequenceSupport
getSequenceSupport()
SqlAstTranslatorFactory
getSqlAstTranslatorFactory()
Return an SqlAstTranslatorFactory specific for the Dialect.TimeZoneSupport
getTimeZoneSupport()
How the Dialect supports time zone types likeTypes.TIMESTAMP_WITH_TIMEZONE
.void
initializeFunctionRegistry(QueryEngine queryEngine)
Initialize the given registry with any dialect-specific functions.boolean
supportsDistinctFromPredicate()
Is this SQL dialect known to support some kind of distinct from predicate.boolean
supportsLateral()
Does this dialect support the SQL lateral keyword or a proprietary alternative?boolean
supportsSkipLocked()
Does this dialect/database support SKIP_LOCKED timeout.String
timestampaddPattern(TemporalUnit unit, jakarta.persistence.TemporalType temporalType, IntervalType intervalType)
Obtain a pattern for the SQL equivalent to atimestampadd()
function call.-
Methods inherited from class org.hibernate.dialect.DB2Dialect
appendBinaryLiteral, appendBooleanValueString, appendDatetimeFormat, buildIdentifierHelper, buildSQLExceptionConversionDelegate, contributeTypes, createUniqueDelegate, doesReadCommittedCauseWritersToBlockReaders, dropConstraints, extractPattern, generatedAs, getCurrentTimestampSelectString, getDefaultDecimalPrecision, getDefaultStatementBatchSize, getDropSchemaCommand, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getFractionalSecondPrecisionInNanos, getInExpressionCountLimit, getLowercaseFunction, getMaxIdentifierLength, getMaxVarcharLength, getReadLockString, getResultSet, getSelectClauseNullString, getSequenceInformationExtractor, getUniqueDelegate, getWriteLockString, isCurrentTimestampSelectStringCallable, registerColumnTypes, registerDefaultKeywords, registerResultSetOutParameter, supportsCommentOn, supportsCurrentTimestampSelection, supportsExistsInSelect, supportsLobValueChangePropagation, supportsLockTimeouts, supportsNonQueryWithCTE, supportsNullPrecedence, supportsOffsetInSubquery, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsTupleDistinctCounts, supportsValuesList, supportsWindowFunctions, timestampdiffPattern, translateExtractField
-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendArrayLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendIntervalLiteral, appendLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, canCreateCatalog, canCreateSchema, castPattern, castType, checkVersion, closeQuote, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, defaultScrollMode, doesRepeatableReadCauseReadersToBlockWriters, equivalentTypes, escapeComment, forceLobAsLastValue, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBooleanCheckCondition, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCurrentSchemaCommand, getDefaultBatchLoadSizingStrategy, getDefaultLobLength, getDefaultNonContextualLobCreation, getDefaultProperties, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDoublePrecision, getDropCatalogCommand, getDropForeignKeyString, getDropTableString, getEnumCheckCondition, getFloatPrecision, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIndexExporter, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getMaxAliasLength, getMaxNVarcharLength, getMaxVarbinaryLength, getMinimumSupportedVersion, getNameQualifierSupport, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getNullOrdering, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getQueryHintString, getReadLockString, getReadRowLockStrategy, getResultSet, getResultSet, getSchemaNameResolver, getSelectGUIDString, getSequenceExporter, getSizeStrategy, getSqmTranslatorFactory, getSupportedTemporaryTableKind, getTableComment, getTableExporter, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getUniqueKeyExporter, getVersion, getViolatedConstraintNameExtractor, getWriteLockString, getWriteRowLockStrategy, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, inlineLiteral, isAnsiNullOn, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLockTimeoutParameterized, openQuote, prependComment, qualifyIndexName, quote, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeDescriptor, resolveSqlTypeLength, supportsBindAsCallableArgument, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFractionalTimestampArithmetic, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsJdbcConnectionLobCreation, supportsNamedParameters, supportsNoColumnsInsert, supportsNoWait, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsStandardArrays, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsValuesListForInsert, supportsWait, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, trimPattern, useFollowOnLocking, useInputStreamToInsertBlob
-
-
-
-
Constructor Detail
-
DB2zDialect
public DB2zDialect(DialectResolutionInfo info)
-
DB2zDialect
public DB2zDialect()
-
DB2zDialect
public DB2zDialect(DatabaseVersion version)
-
-
Method Detail
-
initializeFunctionRegistry
public void initializeFunctionRegistry(QueryEngine queryEngine)
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
- 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])
- 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])
- log10(arg)
- sign(arg)
- sin(arg)
- cos(arg)
- tan(arg)
- asin(arg)
- acos(arg)
- atan(arg)
- atan2(arg0, arg1)
- round(arg0, arg1)
- least(arg0, arg1, ...)
- greatest(arg0, arg1, ...)
- format(datetime as pattern)
- collate(string as collation)
- str(arg) - synonym of cast(a as String)
- ifnull(arg0, arg1) - synonym of coalesce(a, b)
- second(arg) - synonym of extract(second from a)
- minute(arg) - synonym of extract(minute from a)
- hour(arg) - synonym of extract(hour from a)
- day(arg) - synonym of extract(day from a)
- month(arg) - synonym of extract(month from a)
- year(arg) - synonym of extract(year from a)
- Overrides:
initializeFunctionRegistry
in classDB2Dialect
-
columnType
protected String columnType(int sqlTypeCode)
Description copied from class:Dialect
The 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.- Overrides:
columnType
in classDB2Dialect
- Parameters:
sqlTypeCode
- a SQL type code- Returns:
- a column type name, with $l, $p, $s placeholders for length, precision, scale
- See Also:
SqlTypes
-
getDB2Version
public DatabaseVersion getDB2Version()
Description copied from class:DB2Dialect
DB2 LUW Version- Overrides:
getDB2Version
in classDB2Dialect
-
supportsDistinctFromPredicate
public boolean supportsDistinctFromPredicate()
Description copied from class:Dialect
Is this SQL dialect known to support some kind of distinct from predicate. Basically, does it support syntax like "... where FIRST_NAME IS DISTINCT FROM LAST_NAME"- Overrides:
supportsDistinctFromPredicate
in classDB2Dialect
- Returns:
- True if this SQL dialect is known to support some kind of distinct from predicate; false otherwise
-
getTimeZoneSupport
public TimeZoneSupport getTimeZoneSupport()
Description copied from class:Dialect
How the Dialect supports time zone types likeTypes.TIMESTAMP_WITH_TIMEZONE
.- Overrides:
getTimeZoneSupport
in classDialect
-
getSequenceSupport
public SequenceSupport getSequenceSupport()
- Overrides:
getSequenceSupport
in classDB2Dialect
-
getQuerySequencesString
public String getQuerySequencesString()
Description copied from class:Dialect
Get the select command used retrieve the names of all sequences.- Overrides:
getQuerySequencesString
in classDB2Dialect
- Returns:
- The select command; or null if sequences are not supported.
-
getLimitHandler
public LimitHandler getLimitHandler()
Description copied from class:Dialect
Returns aLimitHandler
that implements support forQuery.setMaxResults(int)
andQuery.setFirstResult(int)
for this dialect.- Overrides:
getLimitHandler
in classDB2Dialect
-
getIdentityColumnSupport
public IdentityColumnSupport getIdentityColumnSupport()
Description copied from class:Dialect
Get the appropriateIdentityColumnSupport
- Overrides:
getIdentityColumnSupport
in classDB2Dialect
- Returns:
- the IdentityColumnSupport
-
supportsSkipLocked
public boolean supportsSkipLocked()
Description copied from class:Dialect
Does this dialect/database support SKIP_LOCKED timeout.- Overrides:
supportsSkipLocked
in classDB2Dialect
- Returns:
true
if SKIP_LOCKED is supported
-
supportsLateral
public boolean supportsLateral()
Description copied from class:Dialect
Does this dialect support the SQL lateral keyword or a proprietary alternative?- Overrides:
supportsLateral
in classDB2Dialect
- Returns:
true
if the underlying database supports lateral,false
otherwise. The default isfalse
.
-
timestampaddPattern
public String timestampaddPattern(TemporalUnit unit, jakarta.persistence.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 classDB2Dialect
- 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
-
getSqlAstTranslatorFactory
public SqlAstTranslatorFactory getSqlAstTranslatorFactory()
Description copied from class:Dialect
Return an SqlAstTranslatorFactory specific for the Dialect. Returnnull
to use Hibernate's standard translator.- Overrides:
getSqlAstTranslatorFactory
in classDB2Dialect
- See Also:
StandardSqlAstTranslatorFactory
,JdbcEnvironment.getSqlAstTranslatorFactory()
-
-