Package org.hibernate.dialect
Class TiDBDialect
java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.dialect.MySQLDialect
org.hibernate.dialect.TiDBDialect
- All Implemented Interfaces:
FunctionContributor,TypeContributor,ConversionContext
A SQL dialect for TiDB.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hibernate.dialect.Dialect
Dialect.SizeStrategy, Dialect.SizeStrategyImpl -
Field Summary
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, LEGACY_LOB_MERGE_STRATEGY, LOG_BASE2OF10, NEW_LOCATOR_LOB_MERGE_STRATEGY, QUOTE, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves theFOR UPDATE NOWAITsyntax specific to this dialect.getForUpdateNowaitString(String aliases) Get theFOR UPDATE OF column_list NOWAITfragment appropriate for this dialect, given the aliases of the columns to be write locked.Get this dialect's level of support for primary key functional dependency analysis withinGROUP BYandORDER BYclauses.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.getReadLockString(int timeout) Get the string to append toSELECTstatements to acquire READ locks for this dialect.getReadLockString(String aliases, int timeout) Get the string to append toSELECTstatements to acquire READ locks for this dialect, given the aliases of the columns to be read locked.ASequenceInformationExtractorwhich is able to extractSequenceInformationfrom the JDBC result set returned whenDialect.getQuerySequencesString()is executed.No support for sequences.getWriteLockString(int timeout) Get the string to append toSELECTstatements to acquire pessimistic WRITE locks for this dialect.protected voidRegister the reserved words of ANSI-standard SQL as keywords.booleanDoes this dialect supporton deleteactions in foreign key definitions?booleanDoes this dialect supportNO_WAITtimeout.booleanDoes this dialect/database support recursive CTEs?booleanDoes this dialect supportSKIP_LOCKEDtimeout.booleanDoes this dialect supportWAITtimeout.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.MySQLDialect
appendCheckConstraintOptions, appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendLiteral, buildIdentifierHelper, buildSQLExceptionConversionDelegate, canCreateCatalog, canCreateSchema, canDisableConstraints, castPattern, castType, closeQuote, columnType, contributeTypes, createVersion, createVersion, currentTimestamp, datetimeFormat, dropConstraints, extractPattern, getAddForeignKeyConstraintString, getAlterColumnTypeString, getCharacterSetBytesPerCharacter, getColumnComment, getCreateCatalogCommand, getCreateSchemaCommand, getCurrentTimestampSelectString, getDefaultLobLength, getDefaultMySQLStorageEngine, getDisableConstraintsStatement, getDmlTargetColumnQualifierSupport, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropUniqueKeyString, getEnableConstraintsStatement, getEnumTypeDeclaration, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getFloatPrecision, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getFractionalSecondPrecisionInNanos, getGroupBySelectItemReferenceStrategy, getIdentityColumnSupport, getLimitHandler, getMaxAliasLength, getMaxIdentifierLength, getMaxVarbinaryLength, getMaxVarcharLength, getNameQualifierSupport, getNullColumnString, getNullOrdering, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getResultSet, getSelectGUIDString, getSizeStrategy, getSupportedTemporaryTableKind, getTableComment, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableDropCommand, getViolatedConstraintNameExtractor, getWriteLockString, getWriteRowLockStrategy, hasSelfReferentialForeignKeyBug, initDefaultProperties, initializeFunctionRegistry, isCurrentTimestampSelectStringCallable, isJdbcLogWarningsEnabledByDefault, isNoBackslashEscapesEnabled, openQuote, qualifyIndexName, registerColumnTypes, registerResultSetOutParameter, resolveSqlTypeDescriptor, resolveSqlTypeLength, supportsAlterColumnType, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsFromClauseInUpdate, supportsIfExistsBeforeTableName, supportsIsTrue, supportsLateral, supportsLobValueChangePropagation, supportsLockTimeouts, supportsNullPrecedence, supportsOffsetInSubquery, supportsSubqueryOnMutatingTable, supportsTemporalLiteralOffset, supportsWindowFunctions, timestampdiffPattern, useMaterializedLobWhenCapacityExceededMethods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendArrayLiteral, appendBinaryLiteral, appendBooleanValueString, appendIntervalLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, canBatchTruncate, checkVersion, contribute, contributeFunctions, createOptionalTableUpdateOperation, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestampWithTimeZone, defaultScrollMode, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, doesRoundTemporalOnOverflow, equivalentTypes, escapeComment, forceLobAsLastValue, generatedAs, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAggregateSupport, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckConstraintString, getColumnAliasExtractor, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getCurrentSchemaCommand, getDefaultDecimalPrecision, getDefaultIntervalSecondScale, getDefaultNonContextualLobCreation, getDefaultProperties, getDefaultStatementBatchSize, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintStatement, getDoublePrecision, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropTableString, getEnableConstraintStatement, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getForeignKeyExporter, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getHqlTranslator, getIndexExporter, getInExpressionCountLimit, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarcharCapacity, getMultiKeyLoadSizingStrategy, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNoColumnsInsertString, getNullColumnString, getParameterCountLimit, getPreferredSqlTypeCodeForArray, getQueryHintString, getReadRowLockStrategy, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSqmTranslatorFactory, getTableCleaner, getTableExporter, getTableMigrator, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTimeZoneSupport, getTruncateTableStatement, getTruncateTableStatements, getUniqueDelegate, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, hasAlterTable, hasDataTypeBeforeGeneratedAs, isAnsiNullOn, isEmptyStringTreatedAsNull, isLob, ordinal, prependComment, quote, quoteCollation, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, rowId, rowIdSqlType, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBitType, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsConflictClauseForInsertCTE, supportsDistinctFromPredicate, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFractionalTimestampArithmetic, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTypeName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsInsertReturningRowId, supportsJdbcConnectionLobCreation, supportsMaterializedLobAccess, supportsNamedParameters, supportsNationalizedMethods, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsPartitionBy, supportsPredicateAsExpression, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTableOptions, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUpdateReturning, supportsValuesList, supportsValuesListForInsert, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useConnectionToCreateLob, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob
-
Constructor Details
-
TiDBDialect
public TiDBDialect() -
TiDBDialect
-
TiDBDialect
-
-
Method Details
-
getMySQLVersion
- Overrides:
getMySQLVersionin classMySQLDialect
-
getMinimumSupportedVersion
Description copied from class:DialectGet the version of the SQL dialect that is the minimum supported by this implementation.- Overrides:
getMinimumSupportedVersionin classMySQLDialect
-
registerDefaultKeywords
protected void registerDefaultKeywords()Description copied from class:DialectRegister the reserved words of ANSI-standard SQL as keywords.- Overrides:
registerDefaultKeywordsin classMySQLDialect- See Also:
-
supportsCascadeDelete
public boolean supportsCascadeDelete()Description copied from class:DialectDoes this dialect supporton deleteactions in foreign key definitions?- Overrides:
supportsCascadeDeletein classMySQLDialect- Returns:
trueif the dialect does support theon deleteclause.
-
getQuerySequencesString
Description copied from class:DialectGet theselectcommand used retrieve the names of all sequences.- Overrides:
getQuerySequencesStringin classDialect- Returns:
- The select command; or null if sequences are not supported.
-
getSequenceSupport
Description copied from class:MySQLDialectNo support for sequences.- Overrides:
getSequenceSupportin classMySQLDialect
-
getSequenceInformationExtractor
Description copied from class:DialectASequenceInformationExtractorwhich is able to extractSequenceInformationfrom the JDBC result set returned whenDialect.getQuerySequencesString()is executed.- Overrides:
getSequenceInformationExtractorin classDialect
-
getSqlAstTranslatorFactory
Description copied from class:Dialect- Overrides:
getSqlAstTranslatorFactoryin classMySQLDialect- See Also:
-
supportsRecursiveCTE
public boolean supportsRecursiveCTE()Description copied from class:DialectDoes this dialect/database support recursive CTEs?- Overrides:
supportsRecursiveCTEin classMySQLDialect- Returns:
trueif recursive CTEs are supported
-
supportsSkipLocked
public boolean supportsSkipLocked()Description copied from class:DialectDoes this dialect supportSKIP_LOCKEDtimeout.- Overrides:
supportsSkipLockedin classMySQLDialect- Returns:
trueif SKIP_LOCKED is supported
-
supportsNoWait
public boolean supportsNoWait()Description copied from class:DialectDoes this dialect supportNO_WAITtimeout.- Overrides:
supportsNoWaitin classMySQLDialect- Returns:
trueifNO_WAITis supported
-
supportsWait
public boolean supportsWait()Description copied from class:DialectDoes this dialect supportWAITtimeout.- Overrides:
supportsWaitin classMySQLDialect- Returns:
trueifWAITis supported
-
getReadLockString
Description copied from class:DialectGet the string to append toSELECTstatements to acquire READ locks for this dialect.Location of the returned string is treated the same as
Dialect.getForUpdateString().- Overrides:
getReadLockStringin classMySQLDialect- Parameters:
timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCKclause string.
-
getReadLockString
Description copied from class:DialectGet the string to append toSELECTstatements to acquire READ locks for this dialect, given the aliases of the columns to be read locked.Location of the returned string is treated the same as
Dialect.getForUpdateString().- Overrides:
getReadLockStringin classMySQLDialect- Parameters:
aliases- The columns to be read locked.timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCKclause string.
-
getWriteLockString
Description copied from class:DialectGet the string to append toSELECTstatements to acquire pessimistic WRITE locks for this dialect.Location of the returned string is treated the same as
Dialect.getForUpdateString().- Overrides:
getWriteLockStringin classMySQLDialect- Parameters:
timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCKclause string.
-
getForUpdateNowaitString
Description copied from class:DialectRetrieves theFOR UPDATE NOWAITsyntax specific to this dialect.- Overrides:
getForUpdateNowaitStringin classMySQLDialect- Returns:
- The appropriate
FOR UPDATE NOWAITclause string.
-
getForUpdateNowaitString
Description copied from class:DialectGet theFOR UPDATE OF column_list NOWAITfragment appropriate for this dialect, given the aliases of the columns to be write locked.- Overrides:
getForUpdateNowaitStringin classMySQLDialect- Parameters:
aliases- The columns to be write locked.- Returns:
- The appropriate
FOR UPDATE OF colunm_list NOWAITclause string.
-
getFunctionalDependencyAnalysisSupport
Description copied from class:DialectGet this dialect's level of support for primary key functional dependency analysis withinGROUP BYandORDER BYclauses.- Overrides:
getFunctionalDependencyAnalysisSupportin classMySQLDialect
-
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 classMySQLDialect- 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
-