Class CockroachDialect
- All Implemented Interfaces:
CheckConstraintSupport, ForeignKeySupport, IdentifierSupport, KeywordSupport, LiteralSupport, AlterTableSupport, ColumnDefinitionSupport, ConstraintControlSupport, IndexDdlSupport, TableCreationSupport, TruncateSupport, CurrentTemporalSupport, TemporalFormatSupport, TemporalOperationSupport, ConversionContext
- Direct Known Subclasses:
CockroachDB202SpatialDialect
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PostgreSQLDriverKindprotected static final DatabaseVersionFields 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
ConstructorsConstructorDescriptionCockroachDialect(DatabaseVersion version) CockroachDialect(DatabaseVersion version, PostgreSQLDriverKind driverKind) CockroachDialect(DialectResolutionInfo info, String versionString) -
Method Summary
Modifier and TypeMethodDescriptionalterColumnType(AlterColumnTypeRequest request) voidappendBooleanValueString(SqlAppender appender, boolean bool) Append a SQL Boolean literal expression.voidappendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal for ajava.timevalue.voidappendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal for aCalendarvalue.voidappendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone) Append a datetime literal for a legacyDatevalue.voidappendFormat(SqlAppender appender, String format) Append the database translation of the supplied Hibernate format pattern.Build and supply the configured identifier helper from the stable JDBC metadata snapshot and selected keyword strategy.Supplies vendor-specific SQL-exception conversion for this Dialect.protected StringcastType(int sqlTypeCode) Return the complete cast-target type pattern forsqlTypeCode.booleancausesRollback(SQLException sqlException) Determine whether this database marks the current transaction for rollback after the given statement failure.protected StringcolumnType(int sqlTypeCode) protected voidcontributeCockroachTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) voidcontributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Contribute database-specific Java, JDBC, DDL, and basic type descriptors.Creates the JDBC mutation operation for an optional-table update.Render the current SQL time expression used forjava.sql.Time.Render the current SQL timestamp expression used forjava.sql.Timestamp.Render the current timestamp-with-time-zone expression.Determine the database version, as precise as possible and using Dialect-specific techniques, from aDialectResolutionInfoobject.booleanequivalentTypes(int typeCode1, int typeCode2) Determine directional compatibility of two JDBC or extended SQL type codes.extractPattern(TemporalUnit unit) Theextract()function returnsTemporalUnit.DAY_OF_WEEKnumbered from 0 to 6.protected static DatabaseVersionlongmicrosecondis the smallest unit for aninterval, and the highest precision for atimestamp.Supply the aggregate-column mapping, DDL, read, assignment, and write behavior for this dialect.The independent array syntax and multi-valued parameter-binding behavior of this Dialect.The common-table-expression capabilities of this Dialect.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 preferred default ordinality-column name for a set-returning function.Supply direct JDBC access capabilities for Java Time classes.The qualifier form accepted for target-column references in update and delete statements.The database's support for recognizing primary-key functional dependency ingroup byandorder byclauses.Supply the stable profile describing immediate retrieval of arbitrary database-generated values for this Dialect.Supply the stable identity-column DDL, insert syntax, and identity-specific retrieval behavior for this Dialect.Supply existence-check placement for schema DDL targets.getInformationExtractor(ExtractionContext extractionContext) Supply the context-bound strategy Hibernate uses to discover database tables, keys, indexes, and related schema metadata.Supplies execution-time pagination for already-rendered SQL requested byQuery.setMaxResults(int)orQuery.setFirstResult(int).Supply the database and driver policy for LOB creation, binding, materialization, type classification, mutation ordering, and VALUE LOB DDL.Supplies the cohesive pessimistic-locking profile for this Dialect.intReturn the database's maximum identifier length.protected DatabaseVersionGet the version of the SQL dialect that is the minimum supported by this implementation.The native SQL mutation-syntax capabilities of this Dialect.Supply catalog and schema qualification support, or returnnullto useDatabaseMetaData.Supply catalog and schema lifecycle behavior to schema tooling.Describe how this database represents nationalized character data.Supply the semantic identifier-generation type used for native generation.Supply the database's default null ordering and explicit null-precedence syntax capabilities.The database's native predicate syntax and predicate-placement profile.getQueryHintString(String query, List<String> hintList) Applies the hints to the query string.Supplies the complete database-native row-level-security strategy for this Dialect.The native row-value syntax of this Dialect.Supply schema-drop composition and ordered pre-drop commands.Supply the strategy Hibernate uses to discover existing database sequences and their metadata.Supplies the complete sequence value-expression and lifecycle-DDL strategy for this Dialect.Supply the factory for this Dialect's single-use SQL AST translators.Supplies the database's supported subquery placements.Supply datetime-format translation.Supply extraction and timestamp-arithmetic syntax.Supply temporal precision-adjustment and literal-offset semantics.Select the database's support profile for SQLwith time zonetypes.Supplies the database syntax for ordinary and distinct tuple counts.Supplies this Dialect's resolved type-sizing limits and defaults.The contexts in which this Dialect supports native multi-rowvaluessyntax.Supplies the extractor used to recover violated constraint names from database exceptions.Supplies the native window-function syntax supported by this database.voidinitializeFunctionRegistry(FunctionContributions functionContributions) Contribute the database-specific function descriptors after independent function contributors have run.booleanWhether the current timestamp remains stable throughout a transaction.static DatabaseVersionparseVersion(String versionString) protected static voidregisterArrayFunctions(CommonFunctionFactory functionFactory) protected voidregisterColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Register the inherited ANSI-oriented DDL type descriptors during Dialect type contribution.protected static voidregisterJsonFunctions(CommonFunctionFactory functionFactory) protected IntegerresolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration) Resolve a database-reported type name before base-name extraction.resolveSqlTypeDescriptor(String columnTypeName, int jdbcTypeCode, int precision, int scale, JdbcTypeRegistry jdbcTypeRegistry) Resolve the non-null JDBC descriptor for result-set metadata.timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) Return a timestamp-add pattern containing?1,?2, and?3.timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType) Return a timestamp-difference pattern containing?1,?2, and?3.Translate a duration unit name.Translate an extraction field name.Methods inherited from class Dialect
addPartitionKeyToPrimaryKey, appendArrayLiteral, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildLockingClauseStrategy, buildStringToBooleanCast, buildStringToBooleanCastDecode, castPattern, constraintControlMode, contributeDefaultProperties, contributeKeywords, defaultScrollMode, getAlterTableSupport, getArrayTypeName, getBatchLoadSizingStrategy, getCallableStatementSupport, getCatalogSeparator, getCheckConstraintSupport, getColumnAliasExtractor, getColumnDefinitionSupport, getConstraintControlSupport, getDefaultProperties, getEntityLockingStrategyFactory, getEnumSupport, getExpressionCoercionSupport, getFetchClauseSupport, getForeignKeyExporter, getForeignKeySupport, getGlobalTemporaryTableStrategy, getIdentifierSupport, getIndexDdlSupport, getIndexExporter, getJdbcMetadataOverrides, getKeywords, getKeywordSupport, getLiteralSupport, getLobMergeStrategy, getLocalTemporaryTableStrategy, getLockingClauseStrategy, getLowercaseFunction, getMultiKeyLoadSizingStrategy, getMultiTableMutationSupport, getNativeParameterMarkerStrategy, getObjectNullBindingStrategy, getParameterLimits, getPersistentTemporaryTableStrategy, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintPlacement, getQueryHintString, getRefCursorSupportFactory, getRowIdSupport, getSchemaCommentSupport, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSetOperationSupport, getSetOperatorSqlString, getSingleRowTableSupport, getSizeStrategy, getStringValueSemantics, getSyntheticTableGroupSupport, getTableCleaner, getTableCreationSupport, getTableExporter, getTableMigrator, getTemporalTableSupport, getTemporaryTableExporter, getTruncateSupport, getUniqueDelegate, getUserDefinedTypeExporter, getVersion, isJdbcLogWarningsEnabledByDefault, narrowCastType, resolveSqlTypeCode, resolveSqlTypeLength, supportsCrossJoin, supportsFilterClause, supportsNationalizedMethods, supportsOrdinalSelectItemReference, supportsUserDefinedTypes, throttleDdl, toString, trimPattern, truncateModeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AlterTableSupport
addColumnPrefix, addColumnSuffix, 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, usesStandardCurrentTimestampFunctionMethods inherited from interface ForeignKeySupport
renderAddConstraint, renderDropConstraint, requiresSelfReferentialForeignKeyNullification, supportsAlterTableConstraints, supportsOnDeleteActionMethods inherited from interface IdentifierSupport
closeQuote, getMaxAliasLength, openQuote, quote, quoteCollation, toQuotedIdentifierMethods inherited from interface IndexDdlSupport
createCommand, createTailMethods inherited from interface KeywordSupport
acceptsJdbcKeywordMethods inherited from interface LiteralSupport
appendBinaryLiteral, appendIntervalLiteral, appendIntervalLiteral, appendLiteral, appendUUIDLiteral, toBooleanValueStringMethods inherited from interface TableCreationSupport
createTableCommand, requiresViewColumnList, tableCreationOptionsMethods inherited from interface TruncateSupport
renderCommands
-
Field Details
-
MINIMUM_VERSION
-
driverKind
-
-
Constructor Details
-
CockroachDialect
public CockroachDialect() -
CockroachDialect
-
CockroachDialect
-
CockroachDialect
-
CockroachDialect
-
-
Method Details
-
getDirectJavaTimeJdbcSupport
Description copied from class:DialectSupply direct JDBC access capabilities for Java Time classes. Return one stable, non-null, thread-safe implementation.- Overrides:
getDirectJavaTimeJdbcSupportin classDialect- Returns:
- the direct Java Time JDBC support for this Dialect and driver
- See Also:
-
getTemporalOperationSupport
Description copied from class:DialectSupply extraction and timestamp-arithmetic syntax. Return one stable, non-null, thread-safe implementation. Providers may implementTemporalOperationSupportdirectly and returnthis.- Overrides:
getTemporalOperationSupportin classDialect- See Also:
-
getTemporalFormatSupport
Description copied from class:DialectSupply datetime-format translation. Return one stable, non-null, thread-safe implementation.- Overrides:
getTemporalFormatSupportin classDialect- See Also:
-
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:
-
getTypeSizingProfile
Description copied from class:DialectSupplies this Dialect's resolved type-sizing limits and defaults.
Return
TypeSizingProfile.STANDARDwhen no dimension differs. Construct one stable immutable profile after version and server configuration are known. A family Dialect may copy its superclass profile, but must set every effective dimension which formerly changed through scalar-method delegation because profile builder setters do not cascade.- Overrides:
getTypeSizingProfilein classDialect
-
determineDatabaseVersion
Description copied from class:DialectDetermine the database version, as precise as possible and using Dialect-specific techniques, from aDialectResolutionInfoobject.This method is called during superclass construction by
Dialect(DialectResolutionInfo). Implementations must not depend on subclass initialization. Integration providers may also invoke this method on an existing Dialect when database metadata becomes available after the Dialect was constructed.- Overrides:
determineDatabaseVersionin classDialect- Parameters:
info- The dialect resolution info that would be passed by Hibernate ORM to the constructor of a Dialect of the same type.- Returns:
- The corresponding database version.
-
fetchDataBaseVersion
-
parseVersion
-
getMinimumSupportedVersion
Description copied from class:DialectGet the version of the SQL dialect that is the minimum supported by this implementation.This method is called during superclass construction. Implementations must return construction-safe immutable data and must not depend on subclass initialization.
- Overrides:
getMinimumSupportedVersionin classDialect
-
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
-
castType
Description copied from class:DialectReturn the complete cast-target type pattern for
sqlTypeCode.Override this hook when cast syntax differs from column declaration syntax; otherwise delegate to
Dialect.columnType(int). -
registerColumnTypes
@SPI({IMPLEMENT,SUPPLY}) protected void registerColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) Description copied from class:DialectRegister the inherited ANSI-oriented DDL type descriptors during Dialect type contribution.
Override this focused sub-hook to extend or replace column type registrations. Invoke
superfirst to retain the inherited descriptor set; omitting it deliberately replaces that set. Mutate the supplied boot-scoped registry only during this callback, and do not retain the contribution context or registry afterward. Implement an independentTypeContributorinstead when the contribution is not owned by a Dialect.- Overrides:
registerColumnTypesin classDialect- Parameters:
typeContributions- the Hibernate-supplied contribution targetserviceRegistry- the Hibernate-supplied bootstrap services- See Also:
-
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
-
resolveSqlTypeCode
@SPI({USE,IMPLEMENT}) protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration) Description copied from class:DialectResolve a database-reported type name before base-name extraction.
columnTypeNameis complete and may include parameters or an array suffix. Return null when it cannot be resolved.- Overrides:
resolveSqlTypeCodein classDialect
-
equivalentTypes
Description copied from class:DialectDetermine directional compatibility of two JDBC or extended SQL type codes.
Preserve widening integral compatibility and enum-to-character compatibility as directional relationships; accepting
(a,b)does not imply that(b,a)is accepted. Provider overrides should delegate unmatched pairs.- Overrides:
equivalentTypesin 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.
-
contributeCockroachTypes
protected void contributeCockroachTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) -
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:
-
registerJsonFunctions
-
registerArrayFunctions
-
getDefaultOrdinalityColumnName
Description copied from class:DialectSupplies the preferred default ordinality-column name for a set-returning function.
Return a stable, unqualified SQL column name, or
nullwhen the database does not define a preferred name. Hibernate usesias the fallback and applies collision suffixing where necessary. A null result does not mean that set-returning functions are unsupported.- Overrides:
getDefaultOrdinalityColumnNamein classDialect- Returns:
- the preferred unqualified name, or
nullto use Hibernate's fallback
-
getTimeZoneSupport
Description copied from class:DialectSelect the database's support profile for SQL
with time zonetypes.Override this method to report whether the database preserves the original zone, normalizes values to UTC, or has no native support. This value participates in mapping and JDBC type selection; it does not control temporal-literal syntax.
- Overrides:
getTimeZoneSupportin classDialect- Returns:
- the database time-zone type support profile
- See Also:
-
appendBooleanValueString
Description copied from interface:LiteralSupportAppend a SQL Boolean literal expression.- Specified by:
appendBooleanValueStringin interfaceLiteralSupport
-
getSchemaDropSupport
Description copied from class:DialectSupply schema-drop composition and ordered pre-drop commands.
Return one immutable profile for this Dialect's lifetime.
- Overrides:
getSchemaDropSupportin 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:
-
isCurrentTimestampStable
Description copied from interface:CurrentTemporalSupportWhether the current timestamp remains stable throughout a transaction.- Specified by:
isCurrentTimestampStablein interfaceCurrentTemporalSupport
-
getPredicateSupport
Description copied from class:DialectThe database's native predicate syntax and predicate-placement profile.
Override this method to supply independent support for a native case-insensitive-
likeoperator, scalardistinct from, truthness predicates, and predicates used as value expressions. An absent case-insensitive-likeoperator selects Hibernate's lowercase-expression emulation. Return one immutable, non-null profile whose values remain stable for the lifetime of this Dialect; do not override individual consumers to reproduce these decisions.- Overrides:
getPredicateSupportin classDialect- Returns:
- this Dialect's stable predicate-support profile
-
getIfExistsSupport
Description copied from class:DialectSupply existence-check placement for schema DDL targets.
Return one immutable profile for this Dialect's lifetime.
- Overrides:
getIfExistsSupportin classDialect- See Also:
-
nameQualification
- Specified by:
nameQualificationin interfaceIndexDdlSupport
-
getIdentityColumnSupport
Description copied from class:DialectSupply the stable identity-column DDL, insert syntax, and identity-specific retrieval behavior for this Dialect.
Override this method to supply a provider implementation of
IdentityColumnSupport. Prefer extendingIdentityColumnSupportBaseand return the same immutable or otherwise stable support instance on every invocation. Do not construct Hibernate mutation delegates in this supply point.- Overrides:
getIdentityColumnSupportin classDialect
-
alterColumnType
- Specified by:
alterColumnTypein interfaceAlterTableSupport
-
getValuesListSupport
Description copied from class:DialectThe contexts in which this Dialect supports native multi-row
valuessyntax.The returned immutable profile must be non-null and stable for the lifetime of this Dialect. Report only native syntax support; translator emulation is selected separately.
- Overrides:
getValuesListSupportin classDialect
-
getCteSupport
Description copied from class:DialectThe common-table-expression capabilities of this Dialect.
The returned immutable profile must be non-null and stable for the lifetime of this Dialect. Hibernate may cache and reuse it. Overrides may construct a new profile or copy
CteSupport.STANDARD; invokingsuperis not required. This method is called only after Dialect construction, has no corresponding shutdown lifecycle, and failures propagate to the operation which obtains the profile.- Overrides:
getCteSupportin classDialect
-
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
-
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
-
getNativeValueGenerationStrategy
Description copied from class:DialectSupply the semantic identifier-generation type used for native generation.
Return a non-null typed value instead of a legacy generator name or implementation class. The inherited implementation selects
GenerationType.IDENTITYwhen this Dialect'sIdentityColumnSupportsupports identity columns andGenerationType.SEQUENCEotherwise. Override it when the database's native choice differs from that rule.Legacy
"native"mappings andNativeGeneratorconsume this same provider decision.- Overrides:
getNativeValueGenerationStrategyin classDialect- Returns:
- the non-null semantic native identifier-generation type
- See Also:
-
getSequenceSupport
Description copied from class:DialectSupplies the complete sequence value-expression and lifecycle-DDL strategy for this Dialect.
Return the same stable, thread-safe strategy for the Dialect's lifetime. Use
SequenceSupports.none()when sequences are unsupported, select one of the other stock strategies only when its complete grammar matches the database, or supply a provider implementation ofSequenceSupport.- Overrides:
getSequenceSupportin classDialect- Returns:
- the non-null sequence-support strategy
- See Also:
-
getRowLevelSecurity
Description copied from class:DialectSupplies the complete database-native row-level-security strategy for this Dialect.
Return the same stable, thread-safe strategy for the Dialect's lifetime. Use
RowLevelSecurityStrategies.none()when native row-level security is unsupported, and return declarative DDL instead of mutating boot metadata.- Overrides:
getRowLevelSecurityin classDialect- Returns:
- the non-null row-level-security strategy
- See Also:
-
getSequenceInformationExtractor
Description copied from class:DialectSupply the strategy Hibernate uses to discover existing database sequences and their metadata.
Return
SequenceInformationExtractors.none()when the database version does not expose sequence metadata. Configure ordinary single-query extraction withSequenceInformationExtractors.builder(String), and implementSequenceInformationExtractordirectly only for a genuinely multi-stage algorithm.- Overrides:
getSequenceInformationExtractorin classDialect- See Also:
-
getSqlAstTranslatorFactory
Description copied from class:DialectSupply the factory for this Dialect's single-use SQL AST translators.
Return
nullto useStandardSqlAstTranslatorFactory. A custom Dialect should normally return a reusable factory derived from that class and create translators derived fromAbstractSqlAstTranslatoror an appropriate supported family base. The factory must not retain translation requests, and every translator it returns is used for one translation.- Overrides:
getSqlAstTranslatorFactoryin classDialect- See Also:
-
createOptionalTableUpdateOperation
@SPI({USE,IMPLEMENT,SUPPLY}) public MutationOperation createOptionalTableUpdateOperation(OptionalTableUpdateOperationRequest request) Description copied from class:DialectCreates the JDBC mutation operation for an optional-table update.
Override this factory when the database needs an operation other than the standard update-then-insert behavior. The request contains the semantic update and bootstrap services; implementations must return an operation for the same
OptionalTableUpdateOperationRequest.mutationTarget()and must not retain the request.- Overrides:
createOptionalTableUpdateOperationin classDialect- Returns:
- a non-null operation for the supplied optional-table update
- See Also:
-
getNationalizationSupport
Description copied from class:DialectDescribe how this database represents nationalized character data.
This database SQL-type capability is independent of whether the JDBC driver correctly implements nationalized access methods. Override
Dialect.supportsNationalizedMethods()separately when the driver cannot use those methods.- Overrides:
getNationalizationSupportin classDialect- Returns:
- the database nationalization profile
- See Also:
-
getAggregateSupport
Description copied from class:DialectSupply the aggregate-column mapping, DDL, read, assignment, and write behavior for this dialect. Override this method to return a provider implementation ofAggregateSupport, or retain the standard behavior returned by the default.- Overrides:
getAggregateSupportin classDialect- Returns:
- this dialect's aggregate support
- See Also:
-
getMaxIdentifierLength
Description copied from interface:IdentifierSupportReturn the database's maximum identifier length.- Specified by:
getMaxIdentifierLengthin interfaceIdentifierSupport
-
getArraySupport
Description copied from class:DialectThe independent array syntax and multi-valued parameter-binding behavior of this Dialect.
Override this method to supply standard element-type array support, SQL array-constructor support, and the multi-valued parameter-binding strategy. Treat these as independent dimensions: do not infer syntax support from array binding, and do not infer array binding from either syntax capability. Return one immutable, non-null profile whose values remain stable for the lifetime of this Dialect.
- Overrides:
getArraySupportin classDialect- Returns:
- this Dialect's stable array-support profile
-
getTemporalValueSemantics
Description copied from class:DialectSupply temporal precision-adjustment and literal-offset semantics. Return one stable, non-null immutable profile.- Overrides:
getTemporalValueSemanticsin classDialect- See Also:
-
appendDateTimeLiteral
@SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, TemporalAccessor temporalAccessor, TemporalType precision, TimeZone jdbcTimeZone) Description copied from class:DialectAppend a datetime literal for a
java.timevalue.Preserve the value's offset only when the Dialect's temporal-value semantics permit it. Append immediately and retain no invocation state.
- Specified by:
appendDateTimeLiteralin interfaceLiteralSupport- Overrides:
appendDateTimeLiteralin classDialect
-
appendDateTimeLiteral
@SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, Date date, TemporalType precision, TimeZone jdbcTimeZone) Description copied from class:DialectAppend a datetime literal for a legacy
Datevalue.Apply the supplied JDBC time zone where required, append immediately, and retain no invocation state.
- Specified by:
appendDateTimeLiteralin interfaceLiteralSupport- Overrides:
appendDateTimeLiteralin classDialect
-
appendDateTimeLiteral
@SPI({USE,IMPLEMENT}) public void appendDateTimeLiteral(SqlAppender appender, Calendar calendar, TemporalType precision, TimeZone jdbcTimeZone) Description copied from class:DialectAppend a datetime literal for a
Calendarvalue.Preserve Calendar-specific time-zone and millisecond semantics, append immediately, and retain no invocation state.
- Specified by:
appendDateTimeLiteralin interfaceLiteralSupport- Overrides:
appendDateTimeLiteralin classDialect
-
currentTime
Description copied from interface:CurrentTemporalSupportRender the current SQL time expression used forjava.sql.Time.- Specified by:
currentTimein interfaceCurrentTemporalSupport
-
currentTimestamp
Description copied from interface:CurrentTemporalSupportRender the current SQL timestamp expression used forjava.sql.Timestamp.- Specified by:
currentTimestampin interfaceCurrentTemporalSupport
-
currentTimestampWithTimeZone
Description copied from interface:CurrentTemporalSupportRender the current timestamp-with-time-zone expression.- Specified by:
currentTimestampWithTimeZonein interfaceCurrentTemporalSupport
-
extractPattern
Theextract()function returnsTemporalUnit.DAY_OF_WEEKnumbered from 0 to 6. This isn't consistent with what most other databases do, so here we adjust the result by generating(extract(dayofweek,arg)+1)).- Specified by:
extractPatternin interfaceTemporalOperationSupport
-
translateExtractField
Description copied from interface:TemporalOperationSupportTranslate an extraction field name.- Specified by:
translateExtractFieldin interfaceTemporalOperationSupport
-
fractionalSecondPrecisionInNanos
microsecondis the smallest unit for aninterval, and the highest precision for atimestamp.- Specified by:
fractionalSecondPrecisionInNanosin interfaceTemporalOperationSupport
-
timestampaddPattern
@SPI({USE,IMPLEMENT}) public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) Description copied from interface:TemporalOperationSupportReturn a timestamp-add pattern containing?1,?2, and?3.- Specified by:
timestampaddPatternin interfaceTemporalOperationSupport
-
timestampdiffPattern
@SPI({USE,IMPLEMENT}) public String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalType, TemporalType toTemporalType) Description copied from interface:TemporalOperationSupportReturn a timestamp-difference pattern containing?1,?2, and?3.- Specified by:
timestampdiffPatternin interfaceTemporalOperationSupport
-
translateDurationField
Description copied from interface:TemporalOperationSupportTranslate a duration unit name.- Specified by:
translateDurationFieldin interfaceTemporalOperationSupport
-
appendFormat
Description copied from interface:TemporalFormatSupportAppend the database translation of the supplied Hibernate format pattern.- Specified by:
appendFormatin interfaceTemporalFormatSupport
-
getLimitHandler
Description copied from class:DialectSupplies execution-time pagination for already-rendered SQL requested by
Query.setMaxResults(int)orQuery.setFirstResult(int).This is distinct from SQL AST
PaginationRenderingSupport, which handles offset and fetch clauses represented in the semantic tree. A custom Dialect should normally return a stockLimitHandleror extend a supported handler family. The returned handler may be reused concurrently and must not retain per-query state.- Overrides:
getLimitHandlerin classDialect- Returns:
- a non-null handler
-
getLockingSupport
Description copied from class:DialectSupplies the cohesive pessimistic-locking profile for this Dialect.
The profile coordinates capability metadata, statement-clause rendering, table hints, already-rendered SQL rewriting, connection timeout handling, and follow-on locking. A custom Dialect should supply one internally consistent profile instead of overriding those behaviors independently. The returned support must be non-null and stable for the Dialect lifetime; its components may be reused concurrently and must not retain per-query requests.
- Overrides:
getLockingSupportin classDialect- See Also:
-
getLobSupport
Description copied from class:DialectSupply the database and driver policy for LOB creation, binding, materialization, type classification, mutation ordering, and VALUE LOB DDL. Return one stable, thread-safe strategy for this Dialect.- Overrides:
getLobSupportin classDialect- Returns:
- the non-null LOB support strategy
- See Also:
-
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
-
getGeneratedValuesSupport
Description copied from class:DialectSupply the stable profile describing immediate retrieval of arbitrary database-generated values for this Dialect.
Override this method to declare native insert or update returning, row-id returning, or JDBC generated-key support for arbitrary generated columns. Identity-only retrieval belongs to
Dialect.getIdentityColumnSupport(), and an ordinary select after mutation is a Hibernate fallback rather than a capability of this profile. Refine a family profile by copying the value returned by the superclass and changing only the differing capabilities.- Overrides:
getGeneratedValuesSupportin classDialect
-
getWindowFunctionSupport
Description copied from class:DialectSupplies the native window-function syntax supported by this database.
Return one non-null, immutable profile whose values remain stable for this Dialect's lifetime. Baseline window calls, window partitioning, each frame unit, and frame exclusion are independent grammar facts. Every refinement requires baseline window support, and frame exclusion additionally requires a supported frame unit. Function-specific restrictions and individual frame-bound restrictions remain the responsibility of focused rendering.
When refining a family Dialect, start from
WindowFunctionSupport.builder(super.getWindowFunctionSupport())and change only the differing features.- Overrides:
getWindowFunctionSupportin classDialect- Returns:
- this Dialect's stable window-function-support profile
-
getFunctionalDependencyAnalysisSupport
@SPI({IMPLEMENT,SUPPLY}) public FunctionalDependencyAnalysisSupport getFunctionalDependencyAnalysisSupport()Description copied from class:DialectThe database's support for recognizing primary-key functional dependency in
group byandorder byclauses.This profile controls when Hibernate may omit functionally dependent columns. Report only behavior guaranteed by the database across the Dialect's supported versions.
- Overrides:
getFunctionalDependencyAnalysisSupportin classDialect- Returns:
- a non-null immutable capability profile
- See Also:
-
getNameQualifierSupport
Description copied from class:DialectSupply catalog and schema qualification support, or return
nullto useDatabaseMetaData.This value does not define the catalog separator; override
Dialect.getCatalogSeparator()independently when the metadata-free fallback is not..- Overrides:
getNameQualifierSupportin classDialect- See Also:
-
buildIdentifierHelper
@SPI({USE,IMPLEMENT,SUPPLY}) public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuildRequest request) Description copied from interface:IdentifierSupportBuild and supply the configured identifier helper from the stable JDBC metadata snapshot and selected keyword strategy.
This inherited implementation initializes identifier casing, keywords, and namespace support from the request. Invoke it before replacing any of those values with authoritative provider settings, then build the final helper from the same builder. Settings which this implementation does not initialize may be applied before invoking it. If builder configuration cannot express a database rule, decorate the final helper with
DelegatingIdentifierHelper. Do not retain the request, builder, or metadata view.- Specified by:
buildIdentifierHelperin interfaceIdentifierSupport- See Also:
-
getViolatedConstraintNameExtractor
@SPI({IMPLEMENT,SUPPLY}) public ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor()Description copied from class:DialectSupplies the extractor used to recover violated constraint names from database exceptions.
The extractor returns
nullwhen a name cannot be recovered. Do not use an empty string or sentinel to represent absence.- Specified by:
getViolatedConstraintNameExtractorin interfaceConversionContext- Overrides:
getViolatedConstraintNameExtractorin classDialect- Returns:
- the non-null constraint-name extractor
- See Also:
-
buildSQLExceptionConversionDelegate
@SPI({IMPLEMENT,SUPPLY}) public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()Description copied from class:DialectSupplies vendor-specific SQL-exception conversion for this Dialect.
The returned delegate runs in addition to Hibernate's standard JDBC exception-hierarchy and SQL-state delegates. Its
nullresult means that it declined the exception so conversion may continue. Returnnullfrom this method when the Dialect has no vendor-specific delegate.Prefer stable vendor error codes or SQL states and preserve the original
SQLException.- Overrides:
buildSQLExceptionConversionDelegatein classDialect- Returns:
- the vendor conversion delegate, or
nullwhen none is supplied - See Also:
-
getQueryHintString
Applies the hints to the query string. The hints can be index selection hints or join hints.For index selection hints, use the format
<tablename>@{FORCE_INDEX=<index>[,<DIRECTION>]}where the optional DIRECTION is either ASC (ascending) or DESC (descending). Multiple index hints can be provided. The effect is that in the final SQL statement the hint is added to the table name mentioned in the hint.For join hints, use the format
"<MERGE|HASH|LOOKUP|INVERTED> JOIN". Only one join hint will be added. It is applied to all join statements in the SQL statement.Hints are only added to select statements.
- Overrides:
getQueryHintStringin classDialect- Parameters:
query- The query to which to apply the hint.hintList- The hints to apply- Returns:
- the query with hints added
-
getDmlTargetColumnQualifierSupport
@SPI({USE,IMPLEMENT,SUPPLY}) public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport()Description copied from class:DialectThe qualifier form accepted for target-column references in update and delete statements.
Translators use this value when rendering assignments and predicates. A custom Dialect should return the least permissive form required by the database, not a form used only by an emulation.
- Overrides:
getDmlTargetColumnQualifierSupportin classDialect- Returns:
- the non-null target-column qualifier support
- See Also:
-
getMutationSyntaxSupport
Description copied from class:DialectThe native SQL mutation-syntax capabilities of this Dialect.
The returned immutable profile must be non-null and stable for the lifetime of this Dialect. Report syntax which the translator may use directly; do not report a capability merely because it can be emulated.
QueryMutationRenderingSupportconsumes this profile when selecting a native or emulated plan.- Overrides:
getMutationSyntaxSupportin classDialect
-
getRowValueSupport
Description copied from class:DialectThe native row-value syntax of this Dialect.
Override this method to supply explicit
row(a, b)construction, row equality, ordering, and distinctness comparisons, row-valuedINlists, row-valuedINsubqueries, and quantified row comparisons. Treat each feature as an exact native-syntax declaration: do not inferIN-subquery support fromIN-list support or explicit row construction from comparison support. Copy the superclass profile when refining an inherited Dialect family. Return one immutable, non-null profile whose values remain stable for the lifetime of this Dialect.- Overrides:
getRowValueSupportin classDialect- Returns:
- this Dialect's stable row-value-support profile
-
getInformationExtractor
@SPI({IMPLEMENT,SUPPLY}) public InformationExtractor getInformationExtractor(ExtractionContext extractionContext) Description copied from class:DialectSupply the context-bound strategy Hibernate uses to discover database tables, keys, indexes, and related schema metadata.
Return a new extractor for
extractionContext. Prefer a stock profile fromInformationExtractors, and implementInformationExtractordirectly only when none of those complete profiles matches the database.- Overrides:
getInformationExtractorin classDialect- See Also:
-
causesRollback
Description copied from class:DialectDetermine whether this database marks the current transaction for rollback after the given statement failure.
Inspect the original database exception when the policy depends on its error code, SQL state, or subtype. This decision is independent of how Hibernate converts the exception. This determines both JDBC rollback state and whether a pessimistic lock failure becomes a JPA
PessimisticLockExceptionorLockTimeoutException.- Overrides:
causesRollbackin classDialect- Parameters:
sqlException- the original database exception- Returns:
truewhen the failed statement invalidates the transaction
-
getNamespaceSupport
Description copied from class:DialectSupply catalog and schema lifecycle behavior to schema tooling.
Return one stable, non-null strategy. Prefer a complete immutable profile from
NamespaceSupports, and implementNamespaceSupportdirectly only for custom or multi-command namespace SQL.- Overrides:
getNamespaceSupportin classDialect- See Also:
-