Package org.hibernate.dialect
Class DB2zDialect
java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.dialect.DB2Dialect
org.hibernate.dialect.DB2zDialect
- All Implemented Interfaces:
FunctionContributor,TypeContributor,ConversionContext
A SQL dialect for DB2 for z/OS version 12.1 and above, previously 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
FieldsFields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, FALSE_STRING_VALUES, LEGACY_LOB_MERGE_STRATEGY, LOG_BASE2OF10, NEW_LOCATOR_LOB_MERGE_STRATEGY, QUOTE, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY, TRUE_STRING_VALUES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LockingSupportprotected StringcolumnType(int sqlTypeCode) getCreateIndexString(boolean unique) The command used to create an index, usuallycreate indexorcreate unique index.getCreateIndexTail(boolean unique, List<Column> columns) A string to be appended to the end of thecreate indexcommand, usually to specify thatnullvalues are to be considered distinct.DB2 LUW VersionGet the appropriateIdentityColumnSupportfor this dialect.Obtain aLimitHandlerthat implements pagination support forQuery.setMaxResults(int)andQuery.setFirstResult(int).protected DatabaseVersionGet the version of the SQL dialect that is the minimum supported by this implementation.Get theselectcommand used retrieve the names of all sequences.getRowIdColumnString(String rowId) If this dialect requires that therowidcolumn be declared explicitly, return the DDL column definition.Get the appropriateSequenceSupportfor this dialect.How the dialect supports time zone types likeTypes.TIMESTAMP_WITH_TIMEZONE.The more "standard" syntax isrid_bit(alias)but here we usealias.rowid.intThe JDBC type code of therowid-like pseudo-column which acts as a high-performance row locator.booleanFor dropping a table, can the phraseif existsbe applied before the table name?timestampaddPattern(TemporalUnit unit, 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, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, buildIdentifierHelper, buildSQLExceptionConversionDelegate, canDisableConstraints, castPattern, contributeTypes, createOptionalTableUpdateOperation, createUniqueDelegate, doesReadCommittedCauseWritersToBlockReaders, doesRoundTemporalOnOverflow, dropConstraints, extractPattern, generatedAs, getAggregateSupport, getAlterColumnTypeString, getCallableStatementSupport, getCreateUserDefinedTypeExtensionsString, getCurrentTimestampSelectString, getDefaultDecimalPrecision, getDefaultStatementBatchSize, getDisableConstraintStatement, getDmlTargetColumnQualifierSupport, getDropSchemaCommand, getDual, getEnableConstraintStatement, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getFractionalSecondPrecisionInNanos, getFromDualForSelectOnly, getGlobalTemporaryTableStrategy, getInExpressionCountLimit, getLockingSupport, getMaxIdentifierLength, getMaximumSeriesSize, getMaxVarcharLength, getPreferredSqlTypeCodeForArray, getReadLockString, getReadLockString, getResultSet, getResultSet, getResultSet, getSelectClauseNullString, getSequenceInformationExtractor, getTableExporter, getTruncateTableStatement, getUniqueDelegate, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, initializeFunctionRegistry, isCurrentTimestampSelectStringCallable, registerColumnTypes, registerResultSetOutParameter, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, selectNullString, supportsAlterColumnType, supportsCommentOn, supportsCurrentTimestampSelection, supportsDistinctFromPredicate, supportsExistsInSelect, supportsFromClauseInUpdate, supportsInsertReturning, supportsInsertReturningRowId, supportsIsTrue, supportsLateral, supportsLobValueChangePropagation, supportsNationalizedMethods, supportsNonQueryWithCTE, supportsNullPrecedence, supportsOffsetInSubquery, supportsPartitionBy, supportsRecursiveCTE, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInInSubQuery, supportsRowValueConstructorSyntaxInQuantifiedPredicates, supportsTupleDistinctCounts, supportsUserDefinedTypes, supportsValuesList, supportsWindowFunctions, supportsWithClauseInSubquery, timestampdiffPattern, translateExtractField, useConnectionToCreateLobMethods inherited from class org.hibernate.dialect.Dialect
addPartitionKeyToPrimaryKey, addSqlHintOrComment, addUseIndexQueryHint, appendArrayLiteral, appendCheckConstraintOptions, appendIntervalLiteral, appendIntervalLiteral, appendLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildLockingClauseStrategy, buildOptimisticForceIncrementStrategy, buildOptimisticStrategy, buildPessimisticForceIncrementStrategy, buildPessimisticReadStrategy, buildPessimisticWriteStrategy, buildReadStrategy, buildStringToBooleanCast, buildStringToBooleanCastDecode, buildStringToBooleanDecode, canBatchTruncate, canCreateCatalog, canCreateSchema, castType, checkVersion, closeQuote, contribute, contributeFunctions, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, defaultScrollMode, determineDatabaseVersion, doesRepeatableReadCauseReadersToBlockWriters, equivalentTypes, escapeComment, forceLobAsLastValue, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCascadeConstraintsString, getCaseInsensitiveLike, getCatalogSeparator, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckConstraintString, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getCurrentSchemaCommand, getDefaultIntervalSecondScale, getDefaultLobLength, getDefaultNonContextualLobCreation, getDefaultOrdinalityColumnName, getDefaultProperties, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintsStatement, getDoublePrecision, getDropCatalogCommand, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropForeignKeyString, getDropTableString, getDropUniqueKeyString, getEnableConstraintsStatement, getEnumTypeDeclaration, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFloatPrecision, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctionalDependencyAnalysisSupport, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIndexExporter, getKeywords, getLobMergeStrategy, getLocalTemporaryTableStrategy, getLockingClauseStrategy, getLockingStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarbinaryLength, getMaxVarcharCapacity, getMultiKeyLoadSizingStrategy, getNameQualifierSupport, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNativeValueGenerationStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getNullOrdering, getParameterCountLimit, getPersistentTemporaryTableStrategy, getPessimisticLockStyle, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getQueryHintString, getReadLockString, getReadLockString, getReadRowLockStrategy, getSchemaNameResolver, getSelectClauseNullString, getSelectGUIDString, getSequenceExporter, getSizeStrategy, getSqmTranslatorFactory, getSupportedTemporaryTableKind, getTableCleaner, getTableComment, getTableMigrator, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTruncateTableStatements, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, getWriteLockString, getWriteLockString, getWriteRowLockStrategy, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, openQuote, ordinal, prependComment, qualifyIndexName, quote, quoteCollation, registerDefaultKeywords, registerKeyword, registerKeywords, requiresColumnListInCreateView, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeDescriptor, resolveSqlTypeLength, stripsTrailingSpacesFromChar, supportsArrayConstructor, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBindingNullForSetObject, supportsBindingNullSqlTypeForSetNull, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsConflictClauseForInsertCTE, supportsCrossJoin, supportsDuplicateSelectItemsInQueryGroup, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFilterClause, supportsForUpdate, supportsFractionalTimestampArithmetic, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTypeName, supportsInsertReturningGeneratedKeys, supportsIntersect, supportsJdbcConnectionLobCreation, supportsJoinInMutationStatementSubquery, supportsJoinsInDelete, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNamedColumnCheck, supportsNamedParameters, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsNoColumnsInsert, supportsNoWait, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsPredicateAsExpression, supportsRecursiveCycleClause, supportsRecursiveCycleUsingClause, supportsRecursiveSearchClause, supportsRowConstructor, supportsRowValueConstructorDistinctFromSyntax, supportsRowValueConstructorGtLtSyntax, supportsSimpleQueryGrouping, supportsSkipLocked, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTableOptions, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUpdateReturning, supportsValuesListForInsert, supportsWait, supportsWithClause, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob, useMaterializedLobWhenCapacityExceeded
-
Field Details
-
DB2_LUW_VERSION
-
-
Constructor Details
-
DB2zDialect
-
DB2zDialect
public DB2zDialect() -
DB2zDialect
-
-
Method Details
-
buildLockingSupport
- Overrides:
buildLockingSupportin classDB2Dialect
-
getMinimumSupportedVersion
Description copied from class:DialectGet the version of the SQL dialect that is the minimum supported by this implementation.- Overrides:
getMinimumSupportedVersionin classDB2Dialect
-
columnType
Description copied from class:DialectThe database column type name for a given JDBC type code defined inTypesorSqlTypes. This default implementation returns the ANSI-standard type name.This method may be overridden by concrete
Dialects 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.NCLOBTypes.NCHAR, andTypes.NVARCHAR. On some database, these types are simply remapped toCLOB,CHAR, andVARCHAR. - Mappings for
Types.TIMESTAMPandTypes.TIMESTAMP_WITH_TIMEZONEshould 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-LONGcounterparts. - On the other hand, the types
SqlTypes.LONG32VARCHAR,SqlTypes.LONG32NVARCHAR, andSqlTypes.LONG32VARBINARYare not synonyms, and implementations of this method must define sensible mappings, for example to database-nativeTEXTorCLOBtypes.
- Overrides:
columnTypein classDB2Dialect- Parameters:
sqlTypeCode- a SQLtype code- Returns:
- a column type name, with
$l,$p,$splaceholders for length, precision, scale - See Also:
- Implementations of this method are expected to define a
sensible mapping for
-
getDB2Version
Description copied from class:DB2DialectDB2 LUW Version- Overrides:
getDB2Versionin classDB2Dialect
-
supportsIfExistsBeforeTableName
public boolean supportsIfExistsBeforeTableName()Description copied from class:DialectFor dropping a table, can the phraseif existsbe applied before the table name?- Overrides:
supportsIfExistsBeforeTableNamein classDB2Dialect- Returns:
trueifif existscan be applied before the table name
-
getCreateIndexString
Description copied from class:DialectThe command used to create an index, usuallycreate indexorcreate unique index.- Overrides:
getCreateIndexStringin classDialect- Parameters:
unique-trueif the index is a unique index- Returns:
- The command used to create an index.
-
getCreateIndexTail
Description copied from class:DialectA string to be appended to the end of thecreate indexcommand, usually to specify thatnullvalues are to be considered distinct.- Overrides:
getCreateIndexTailin classDB2Dialect
-
getTimeZoneSupport
Description copied from class:DialectHow the dialect supports time zone types likeTypes.TIMESTAMP_WITH_TIMEZONE.- Overrides:
getTimeZoneSupportin classDialect
-
getSequenceSupport
Description copied from class:DialectGet the appropriateSequenceSupportfor this dialect.- Overrides:
getSequenceSupportin classDB2Dialect
-
getQuerySequencesString
Description copied from class:DialectGet theselectcommand used retrieve the names of all sequences.- Overrides:
getQuerySequencesStringin classDB2Dialect- Returns:
- The select command; or null if sequences are not supported.
-
getLimitHandler
Description copied from class:DialectObtain aLimitHandlerthat implements pagination support forQuery.setMaxResults(int)andQuery.setFirstResult(int).- Overrides:
getLimitHandlerin classDB2Dialect
-
getIdentityColumnSupport
Description copied from class:DialectGet the appropriateIdentityColumnSupportfor this dialect.- Overrides:
getIdentityColumnSupportin classDB2Dialect- Returns:
- the IdentityColumnSupport
-
timestampaddPattern
public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) Description copied from class:DialectObtain a pattern for the SQL equivalent to atimestampadd()function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.- Overrides:
timestampaddPatternin 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
Description copied from class:Dialect- Overrides:
getSqlAstTranslatorFactoryin classDB2Dialect- See Also:
-
rowId
Description copied from class:DB2DialectThe 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:
rowIdin classDB2Dialect- 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:DialectThe JDBC type code of therowid-like pseudo-column which acts as a high-performance row locator.- Overrides:
rowIdSqlTypein classDB2Dialect- Returns:
Types.ROWIDby default
-
getRowIdColumnString
Description copied from class:DialectIf this dialect requires that therowidcolumn be declared explicitly, return the DDL column definition.- Overrides:
getRowIdColumnStringin classDialect- Returns:
- the DDL column definition, or
nullif therowidis an implicit pseudo-column
-