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
public class TiDBDialect extends MySQLDialect
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_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description TiDBDialect()TiDBDialect(DatabaseVersion version)TiDBDialect(DialectResolutionInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetForUpdateNowaitString()Retrieves theFOR UPDATE NOWAITsyntax specific to this dialect.StringgetForUpdateNowaitString(String aliases)Get theFOR UPDATE OF column_list NOWAITfragment appropriate for this dialect, given the aliases of the columns to be write locked.DatabaseVersiongetMySQLVersion()StringgetQuerySequencesString()Get theselectcommand used retrieve the names of all sequences.StringgetReadLockString(int timeout)Get the string to append toSELECTstatements to acquire READ locks for this dialect.StringgetReadLockString(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.SequenceInformationExtractorgetSequenceInformationExtractor()ASequenceInformationExtractorwhich is able to extractSequenceInformationfrom the JDBC result set returned whenDialect.getQuerySequencesString()is executed.SequenceSupportgetSequenceSupport()No support for sequences.SqlAstTranslatorFactorygetSqlAstTranslatorFactory()StringgetWriteLockString(int timeout)Get the string to append toSELECTstatements to acquire pessimistic WRITE locks for this dialect.protected voidregisterDefaultKeywords()Register the reserved words of ANSI-standard SQL as keywords.booleansupportsCascadeDelete()Does this dialect supporton deleteactions in foreign key definitions?booleansupportsNoWait()Does this dialect supportNO_WAITtimeout.booleansupportsRecursiveCTE()Does this dialect/database support recursive CTEs?booleansupportsWait()Does this dialect supportWAITtimeout.-
Methods inherited from class org.hibernate.dialect.MySQLDialect
appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendLiteral, buildIdentifierHelper, buildSQLExceptionConversionDelegate, canCreateCatalog, canCreateSchema, canDisableConstraints, castPattern, castType, closeQuote, columnType, contributeTypes, createVersion, currentTimestamp, datetimeFormat, dropConstraints, extractPattern, getAddForeignKeyConstraintString, getAlterColumnTypeString, getCharacterSetBytesPerCharacter, getCheckCondition, getColumnComment, getCreateCatalogCommand, getCreateSchemaCommand, getCurrentTimestampSelectString, getDefaultLobLength, getDefaultMySQLStorageEngine, getDisableConstraintsStatement, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropUniqueKeyString, getEnableConstraintsStatement, getEnumTypeDeclaration, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getFloatPrecision, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getFractionalSecondPrecisionInNanos, getGroupBySelectItemReferenceStrategy, getIdentityColumnSupport, getLimitHandler, getMaxAliasLength, getMaxIdentifierLength, getMaxVarbinaryLength, getMaxVarcharLength, getMinimumSupportedVersion, 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, supportsAlterColumnType, supportsColumnCheck, supportsCurrentTimestampSelection, supportsIfExistsBeforeTableName, supportsLateral, supportsLobValueChangePropagation, supportsLockTimeouts, supportsNullPrecedence, supportsOffsetInSubquery, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsTemporalLiteralOffset, supportsWindowFunctions, timestampaddPattern, timestampdiffPattern, useMaterializedLobWhenCapacityExceeded
-
Methods 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, equivalentTypes, escapeComment, forceLobAsLastValue, generatedAs, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAggregateSupport, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCheckCondition, getColumnAliasExtractor, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCurrentSchemaCommand, getDefaultBatchLoadSizingStrategy, getDefaultDecimalPrecision, getDefaultNonContextualLobCreation, getDefaultProperties, getDefaultStatementBatchSize, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintStatement, getDoublePrecision, getDropTableString, getEnableConstraintStatement, getFallbackSchemaManagementTool, getForeignKeyExporter, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getHqlTranslator, getIndexExporter, getInExpressionCountLimit, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarcharCapacity, getNationalizationSupport, getNativeIdentifierGenerationType, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNoColumnsInsertString, getNullColumnString, getPreferredSqlTypeCodeForArray, getQueryHintString, getReadRowLockStrategy, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSqmTranslatorFactory, getTableCleaner, getTableExporter, getTableMigrator, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeZoneSupport, getTruncateTableStatement, getTruncateTableStatements, getUniqueDelegate, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, hasAlterTable, hasDataTypeBeforeGeneratedAs, inlineLiteral, isAnsiNullOn, isEmptyStringTreatedAsNull, isLockTimeoutParameterized, ordinal, prependComment, quote, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeLength, rowId, rowIdSqlType, supportsBindAsCallableArgument, supportsBitType, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsCommentOn, supportsDistinctFromPredicate, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFractionalTimestampArithmetic, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTypeName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsJdbcConnectionLobCreation, supportsMaterializedLobAccess, supportsNamedParameters, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsPredicateAsExpression, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsValuesList, supportsValuesListForInsert, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, useFollowOnLocking, useInputStreamToInsertBlob
-
-
-
-
Constructor Detail
-
TiDBDialect
public TiDBDialect()
-
TiDBDialect
public TiDBDialect(DatabaseVersion version)
-
TiDBDialect
public TiDBDialect(DialectResolutionInfo info)
-
-
Method Detail
-
getMySQLVersion
public DatabaseVersion getMySQLVersion()
- Overrides:
getMySQLVersionin classMySQLDialect
-
registerDefaultKeywords
protected void registerDefaultKeywords()
Description copied from class:DialectRegister the reserved words of ANSI-standard SQL as keywords.- Overrides:
registerDefaultKeywordsin classMySQLDialect- See Also:
AnsiSqlKeywords
-
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
public String 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
public SequenceSupport getSequenceSupport()
Description copied from class:MySQLDialectNo support for sequences.- Overrides:
getSequenceSupportin classMySQLDialect
-
getSequenceInformationExtractor
public SequenceInformationExtractor getSequenceInformationExtractor()
Description copied from class:DialectASequenceInformationExtractorwhich is able to extractSequenceInformationfrom the JDBC result set returned whenDialect.getQuerySequencesString()is executed.- Overrides:
getSequenceInformationExtractorin classDialect
-
getSqlAstTranslatorFactory
public SqlAstTranslatorFactory getSqlAstTranslatorFactory()
Description copied from class:Dialect- Overrides:
getSqlAstTranslatorFactoryin classMySQLDialect- See Also:
StandardSqlAstTranslatorFactory,JdbcEnvironment.getSqlAstTranslatorFactory()
-
supportsRecursiveCTE
public boolean supportsRecursiveCTE()
Description copied from class:DialectDoes this dialect/database support recursive CTEs?- Overrides:
supportsRecursiveCTEin classMySQLDialect- Returns:
trueif recursive CTEs are 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
public String getReadLockString(int timeout)
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
public String getReadLockString(String aliases, int timeout)
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
public String getWriteLockString(int timeout)
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
public 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
public String getForUpdateNowaitString(String aliases)
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.
-
-