Class AbstractTransactSQLDialect
- All Implemented Interfaces:
CheckConstraintSupport, ForeignKeySupport, IdentifierSupport, KeywordSupport, LiteralSupport, AlterTableSupport, ColumnDefinitionSupport, ConstraintControlSupport, IndexDdlSupport, TableCreationSupport, TruncateSupport, CurrentTemporalSupport, TemporalOperationSupport, ConversionContext
- Direct Known Subclasses:
SQLServerDialect, SybaseDialect
A supported base for provider Dialects derived from the Transact-SQL family, including Sybase and Microsoft SQL Server variants.
Provider subclasses must invoke a protected constructor classified
IMPLEMENT. The generated SPI inventory identifies
the constructors and members covered by this type-level implementation
contract; unclassified implementation details are not provider extension
points.
-
Field Summary
Fields inherited from class Dialect
LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGYFields inherited from interface ConstraintControlSupport
NONEFields inherited from interface TruncateSupport
STANDARD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected -
Method Summary
Modifier and TypeMethodDescriptionvoidappendBinaryLiteral(SqlAppender appender, byte[] bytes) Append a SQL binary literal.protected StringcolumnType(int sqlTypeCode) protected voidcontributeDefaultProperties(Properties properties) Contribute provider configuration defaults after Dialect construction.voidcontributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Contribute database-specific Java, JDBC, DDL, and basic type descriptors.Supply current temporal expressions and database-side timestamp retrieval.Select the JDBC command used for database-side current timestamp retrieval, or returnnullwhen the database offers no supported command.Supplies the expression-coercion adaptations required by this database.Supply the common Transact-SQL identity profile.Supplies this Dialect's local temporary-table strategy.getLockingClauseStrategy(QuerySpec querySpec, LockOptions lockOptions) Supplies the per-translation strategy for a statement-level [PessimisticLockStyle#CLAUSE locking clause].Select the Hibernate-owned fallback families used for SQM update/delete and insert operations targeting entities mapped to multiple tables.Supply the database's default null ordering and explicit null-precedence syntax capabilities.intSelect the defaultSqlTypescode for Javabooleanmappings.Supplies the database's supported subquery placements.Supplies the database syntax for ordinary and distinct tuple counts.voidinitializeFunctionRegistry(FunctionContributions functionContributions) Contribute the database-specific function descriptors after independent function contributors have run.static StringreplaceLtrimRtrim(TrimSpec specification, boolean isWhitespace) resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Resolve the non-null JDBC descriptor for result-set metadata.trimPattern(TrimSpec specification, boolean isWhitespace) Obtain a pattern for the SQL equivalent to atrim()function call.Methods inherited from class Dialect
addPartitionKeyToPrimaryKey, appendArrayLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildLockingClauseStrategy, buildSQLExceptionConversionDelegate, buildStringToBooleanCast, buildStringToBooleanCastDecode, castPattern, castType, causesRollback, constraintControlMode, contributeKeywords, createOptionalTableUpdateOperation, defaultScrollMode, determineDatabaseVersion, equivalentTypes, getAggregateSupport, getAlterTableSupport, getArraySupport, getArrayTypeName, getBatchLoadSizingStrategy, getCallableStatementSupport, getCatalogSeparator, getCheckConstraintSupport, getColumnAliasExtractor, getColumnDefinitionSupport, getConstraintControlSupport, getCteSupport, getDefaultOrdinalityColumnName, getDefaultProperties, getDirectJavaTimeJdbcSupport, getDmlTargetColumnQualifierSupport, getEntityLockingStrategyFactory, getEnumSupport, getFetchClauseSupport, getForeignKeyExporter, getForeignKeySupport, getFunctionalDependencyAnalysisSupport, getGeneratedValuesSupport, getGlobalTemporaryTableStrategy, getIdentifierSupport, getIfExistsSupport, getIndexDdlSupport, getIndexExporter, getInformationExtractor, getJdbcMetadataOverrides, getKeywords, getKeywordSupport, getLimitHandler, getLiteralSupport, getLobMergeStrategy, getLobSupport, getLockingSupport, getLowercaseFunction, getMinimumSupportedVersion, getMultiKeyLoadSizingStrategy, getMutationSyntaxSupport, getNameQualifierSupport, getNamespaceSupport, getNationalizationSupport, getNativeParameterMarkerStrategy, getNativeValueGenerationStrategy, getObjectNullBindingStrategy, getParameterLimits, getPersistentTemporaryTableStrategy, getPredicateSupport, getPreferredSqlTypeCodeForArray, getQueryHintPlacement, getQueryHintString, getQueryHintString, getRefCursorSupportFactory, getRowIdSupport, getRowLevelSecurity, getRowValueSupport, getSchemaCommentSupport, getSchemaDropSupport, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSequenceInformationExtractor, getSequenceSupport, getSetOperationSupport, getSetOperatorSqlString, getSingleRowTableSupport, getSizeStrategy, getSqlAstTranslatorFactory, getStringValueSemantics, getSyntheticTableGroupSupport, getTableCleaner, getTableCreationSupport, getTableExporter, getTableMigrator, getTemporalFormatSupport, getTemporalOperationSupport, getTemporalTableSupport, getTemporalValueSemantics, getTemporaryTableExporter, getTimeZoneSupport, getTruncateSupport, getTypeSizingProfile, getUniqueDelegate, getUserDefinedTypeExporter, getValuesListSupport, getVersion, getViolatedConstraintNameExtractor, getWindowFunctionSupport, isJdbcLogWarningsEnabledByDefault, narrowCastType, registerColumnTypes, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeLength, supportsCrossJoin, supportsFilterClause, supportsNationalizedMethods, supportsOrdinalSelectItemReference, supportsUserDefinedTypes, throttleDdl, toString, truncateModeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AlterTableSupport
addColumnSuffix, alterColumnType, alterTableCommandMethods inherited from interface CheckConstraintSupport
render, supportsMethods inherited from interface ColumnDefinitionSupport
appendDefinitionMethods inherited from interface ConstraintControlSupport
disableCommands, disableConstraintCommands, enableCommands, enableConstraintCommandsMethods inherited from interface CurrentTemporalSupport
currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, isCurrentTimestampStable, usesStandardCurrentTimestampFunctionMethods inherited from interface ForeignKeySupport
renderAddConstraint, renderDropConstraint, requiresSelfReferentialForeignKeyNullification, supportsAlterTableConstraints, supportsOnDeleteActionMethods inherited from interface IdentifierSupport
buildIdentifierHelper, closeQuote, getMaxAliasLength, getMaxIdentifierLength, openQuote, quote, quoteCollation, toQuotedIdentifierMethods inherited from interface IndexDdlSupport
createCommand, createTailMethods inherited from interface KeywordSupport
acceptsJdbcKeywordMethods inherited from interface LiteralSupport
appendBooleanValueString, appendIntervalLiteral, appendIntervalLiteral, appendLiteral, appendUUIDLiteral, toBooleanValueStringMethods inherited from interface TableCreationSupport
createTableCommand, requiresViewColumnList, tableCreationOptionsMethods inherited from interface TemporalOperationSupport
extractPattern, fractionalSecondPrecisionInNanos, timestampaddPattern, timestampdiffPattern, translateDurationField, translateExtractFieldMethods inherited from interface TruncateSupport
renderCommands
-
Constructor Details
-
AbstractTransactSQLDialect
-
AbstractTransactSQLDialect
-
-
Method Details
-
getCurrentTemporalSupport
Description copied from class:DialectSupply current temporal expressions and database-side timestamp retrieval. Return one stable, non-null, thread-safe implementation. Providers may implementCurrentTemporalSupportdirectly and returnthis.- Overrides:
getCurrentTemporalSupportin classDialect- See Also:
-
columnType
Description copied from class:DialectReturn the complete database column declaration pattern for a JDBC
Typesor HibernateSqlTypescode used during type registration.Use only
$l,$p, and$sfor length, precision, and scale. Define distinct mappings for theLONG32codes; the JDBCLONGsynonyms are normalized before this hook. Delegate unknown inherited codes to the superclass so its standard exception remains authoritative.- Overrides:
columnTypein classDialect
-
contributeTypes
@SPI({IMPLEMENT,SUPPLY}) public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Description copied from class:DialectContribute database-specific Java, JDBC, DDL, and basic type descriptors.
Override this method when the database or JDBC driver requires descriptors beyond the inherited registrations. Invoke
superfirst unless the Dialect intentionally replaces the complete inherited contribution protocol. Obtain reusable dialect-specific JDBC descriptors from the family facades inorg.hibernate.dialect.type.spi, and preserve whether a descriptor replaces an existing registration or is added only when absent.- Overrides:
contributeTypesin classDialect- Parameters:
typeContributions- the Hibernate-supplied contribution registryserviceRegistry-the Hibernate-supplied services, including class loading used by driver-backed descriptor factories
Mutate the supplied boot-scoped registries only during this callback and do not retain the contribution context or a mutable registry afterward. Implement an independent
TypeContributorinstead when the contribution is not owned by a Dialect.
-
contributeDefaultProperties
Description copied from class:DialectContribute provider configuration defaults after Dialect construction.
Invoke
superfirst to extend the inherited defaults. Omittingsuperdeliberately replaces them. Mutate the supplied isolated property bag only during this callback; do not retain it or callDialect.getDefaultProperties()from a Dialect constructor.- Overrides:
contributeDefaultPropertiesin classDialect- Parameters:
properties- the isolated contribution target
-
resolveSqlTypeDescriptor
@SPI({USE,IMPLEMENT}) public JdbcType resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Description copied from class:DialectResolve the non-null JDBC descriptor for result-set metadata.
Preserve vendor replacement and array-component resolution, and delegate unmatched codes to
jdbcTypeRegistry.- Overrides:
resolveSqlTypeDescriptorin classDialect
-
getPreferredSqlTypeCodeForBoolean
Description copied from class:DialectSelect the default
SqlTypescode for Javabooleanmappings.Return a Boolean-compatible code such as
SqlTypes.BOOLEAN,SqlTypes.BIT,SqlTypes.SMALLINT,SqlTypes.TINYINT, orSqlTypes.INTEGER. Thehibernate.type.preferred_boolean_jdbc_typesetting takes precedence over this Dialect default. This method selects a type code; contribute a JDBC descriptor or customize DDL rendering through their dedicated contracts.- Overrides:
getPreferredSqlTypeCodeForBooleanin classDialect- Returns:
- a Boolean-compatible type code defined by
SqlTypes - See Also:
-
initializeFunctionRegistry
@SPI({IMPLEMENT,SUPPLY}) public void initializeFunctionRegistry(FunctionContributions functionContributions) Description copied from class:DialectContribute the database-specific function descriptors after independent function contributors have run.
Override this callback to extend or replace the inherited function set. Invoke
superfirst to retain Hibernate's standard and emulated registrations; omitting it deliberately replaces that set. Mutate the supplied boot-scoped function registry only during this callback, and do not retain the contribution context or registry afterward. Implement an independentFunctionContributorinstead when the contribution is not owned by a Dialect.- Overrides:
initializeFunctionRegistryin classDialect- Parameters:
functionContributions- the Hibernate-supplied function contribution target- See Also:
-
trimPattern
Description copied from class:DialectObtain a pattern for the SQL equivalent to atrim()function call. The resulting pattern must contain a ?1 placeholder for the argument of typeStringand a ?2 placeholder for the trim character ifisWhitespacewas false.- Overrides:
trimPatternin classDialect- Parameters:
specification- leading, trailing, or bothisWhitespace-trueif trimming whitespace, and the ?2 placeholder for the trim character should be omitted,falseif the trim character is explicit and the ?2 placeholder must be included in the pattern
-
replaceLtrimRtrim
-
addColumnPrefix
- Specified by:
addColumnPrefixin interfaceAlterTableSupport
-
nameQualification
- Specified by:
nameQualificationin interfaceIndexDdlSupport
-
getLockingClauseStrategy
Description copied from class:DialectSupplies the per-translation strategy for a statement-level [PessimisticLockStyle#CLAUSE locking clause].- Overrides:
getLockingClauseStrategyin classDialect- See Also:
-
getCurrentTimestampSelection
Description copied from interface:CurrentTemporalSupportSelect the JDBC command used for database-side current timestamp retrieval, or returnnullwhen the database offers no supported command.- Specified by:
getCurrentTimestampSelectionin interfaceCurrentTemporalSupport- See Also:
-
getNullOrderingSupport
Description copied from class:DialectSupply the database's default null ordering and explicit null-precedence syntax capabilities.
Override this method with a stable, non-null profile when the database's default null placement differs from
NullOrderingSupport.STANDARD, or when it cannot rendernulls firstandnulls lastnatively. Dialect subclasses refining a family profile should copyDialect.getNullOrderingSupport()from the superclass and change only the values which differ.- Overrides:
getNullOrderingSupportin classDialect- Returns:
- the stable, non-null null-ordering-support profile
-
getExpressionCoercionSupport
Description copied from class:DialectSupplies the expression-coercion adaptations required by this database.
Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Each requirement directs a focused rendering adaptation; it does not report general database cast support. When refining a family Dialect, start from
ExpressionCoercionSupport.builder(super.getExpressionCoercionSupport())and change only the differing requirement.- Overrides:
getExpressionCoercionSupportin classDialect- Returns:
- this Dialect's stable expression-coercion requirement profile
-
getMultiTableMutationSupport
Description copied from class:DialectSelect the Hibernate-owned fallback families used for SQM update/delete and insert operations targeting entities mapped to multiple tables.
A custom Dialect should return one of the named profiles when both operation families use the same strategy kind, or construct an asymmetric profile when they differ. Local, global, and persistent-table selections require the corresponding non-null temporary-table strategy, while
CTErequires non-query CTE support.Configured global and entity-specific custom strategies take precedence over this fallback. Supply a custom execution implementation with
QuerySettings.QUERY_MULTI_TABLE_MUTATION_STRATEGYorQuerySettings.QUERY_MULTI_TABLE_INSERT_STRATEGYinstead of depending on Hibernate's internal fallback implementations.- Overrides:
getMultiTableMutationSupportin classDialect- Returns:
- a stable, non-null fallback selection profile
-
getLocalTemporaryTableStrategy
Description copied from class:DialectSupplies this Dialect's local temporary-table strategy.
Return
nullwhen the database has no supported local temporary-table form. A non-null strategy must be stable for the Dialect lifetime and consistent withDialect.getTemporaryTableExporter().- Overrides:
getLocalTemporaryTableStrategyin classDialect
-
getSubquerySupport
Description copied from class:DialectSupplies the database's supported subquery placements.
Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Declare every placement independently. In particular, scalar subqueries in the select list and
existspredicates in the select list are separate capabilities. Lateral spelling and fallback rendering remain translator responsibilities. When refining a family Dialect, start fromSubquerySupport.builder(super.getSubquerySupport())and change only the differing placements.- Overrides:
getSubquerySupportin classDialect- Returns:
- this Dialect's stable subquery-support profile
-
getTupleCountSupport
Description copied from class:DialectSupplies the database syntax for ordinary and distinct tuple counts.
Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Select
TupleCountSupport.Syntax.UNSUPPORTEDto use Hibernate's existing emulation,TupleCountSupport.Syntax.ARGUMENT_LISTfor syntax such ascount(a, b), orTupleCountSupport.Syntax.PARENTHESIZED_TUPLEfor syntax such ascount((a, b)). Configure the ordinary and distinct forms independently; a database may require different forms for them. When refining a family Dialect, copyDialect.getTupleCountSupport()from the superclass and replace only the differing syntax choice.- Overrides:
getTupleCountSupportin classDialect- Returns:
- the non-null tuple-count-syntax profile
-
getIdentityColumnSupport
Supply the common Transact-SQL identity profile. Subclasses may override this profile when their identity declaration or retrieval SQL differs.- Overrides:
getIdentityColumnSupportin classDialect- Since:
- 8.0
-
appendBinaryLiteral
Description copied from interface:LiteralSupportAppend a SQL binary literal.- Specified by:
appendBinaryLiteralin interfaceLiteralSupport
-