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, FALSE_STRING_VALUES, LEGACY_LOB_MERGE_STRATEGY, LOG_BASE2OF10, NEW_LOCATOR_LOB_MERGE_STRATEGY, QUOTE, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY, TRUE_STRING_VALUES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionHow does this dialect support aggregate types likeSqlTypes.STRUCT
.getDual()
Returns a table expression that has one row.Retrieves theFOR UPDATE NOWAIT
syntax specific to this dialect.getForUpdateNowaitString
(String aliases) Get theFOR UPDATE OF column_list NOWAIT
fragment 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 BY
andORDER BY
clauses.protected DatabaseVersion
Get the version of the SQL dialect that is the minimum supported by this implementation.Get theselect
command used retrieve the names of all sequences.getReadLockString
(int timeout) Get the string to append toSELECT
statements to acquire READ locks for this dialect.getReadLockString
(String aliases, int timeout) Get the string to append toSELECT
statements to acquire READ locks for this dialect, given the aliases of the columns to be read locked.ASequenceInformationExtractor
which is able to extractSequenceInformation
from the JDBC result set returned whenDialect.getQuerySequencesString()
is executed.No support for sequences.getWriteLockString
(int timeout) Get the string to append toSELECT
statements to acquire pessimistic WRITE locks for this dialect.protected void
Register the reserved words of ANSI-standard SQL as keywords.boolean
Does this dialect supporton delete
actions in foreign key definitions?boolean
Does this dialect supportNO_WAIT
timeout.boolean
Does this dialect/database support recursive CTEs?boolean
Does this dialect supportSKIP_LOCKED
timeout.boolean
Does this dialect supportWAIT
timeout.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
appendBooleanValueString, 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, getMaximumSeriesSize, getMaxVarbinaryLength, getMaxVarcharLength, getNameQualifierSupport, getNullColumnString, getNullOrdering, getPreferredSqlTypeCodeForArray, 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, stripsTrailingSpacesFromChar, supportsAlterColumnType, supportsBindingNullSqlTypeForSetNull, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsFromClauseInUpdate, supportsIfExistsBeforeTableName, supportsIsTrue, supportsLateral, supportsLobValueChangePropagation, supportsLockTimeouts, supportsNullPrecedence, supportsOffsetInSubquery, supportsSubqueryOnMutatingTable, supportsTemporalLiteralOffset, supportsWindowFunctions, timestampdiffPattern, useMaterializedLobWhenCapacityExceeded
Methods inherited from class org.hibernate.dialect.Dialect
addQueryHints, addSqlHintOrComment, appendArrayLiteral, appendBinaryLiteral, appendIntervalLiteral, appendIntervalLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildStringToBooleanCast, buildStringToBooleanCastDecode, buildStringToBooleanDecode, canBatchTruncate, checkVersion, contribute, contributeFunctions, createOptionalTableUpdateOperation, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestampWithTimeZone, defaultScrollMode, determineDatabaseVersion, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, doesRoundTemporalOnOverflow, equivalentTypes, escapeComment, forceLobAsLastValue, generatedAs, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, 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, getDefaultOrdinalityColumnName, getDefaultProperties, getDefaultStatementBatchSize, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintStatement, getDoublePrecision, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropTableString, getEnableConstraintStatement, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getForeignKeyExporter, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFromDualForSelectOnly, getHqlTranslator, getIndexExporter, getInExpressionCountLimit, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarcharCapacity, getMultiKeyLoadSizingStrategy, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNativeValueGenerationStrategy, getNoColumnsInsertString, getNullColumnString, getParameterCountLimit, 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, isEmptyStringTreatedAsNull, isLob, ordinal, prependComment, quote, quoteCollation, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, rowId, rowIdSqlType, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBindingNullForSetObject, 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:
getMySQLVersion
in classMySQLDialect
-
getMinimumSupportedVersion
Description copied from class:Dialect
Get the version of the SQL dialect that is the minimum supported by this implementation.- Overrides:
getMinimumSupportedVersion
in classMySQLDialect
-
registerDefaultKeywords
protected void registerDefaultKeywords()Description copied from class:Dialect
Register the reserved words of ANSI-standard SQL as keywords.- Overrides:
registerDefaultKeywords
in classMySQLDialect
- See Also:
-
supportsCascadeDelete
public boolean supportsCascadeDelete()Description copied from class:Dialect
Does this dialect supporton delete
actions in foreign key definitions?- Overrides:
supportsCascadeDelete
in classMySQLDialect
- Returns:
true
if the dialect does support theon delete
clause.
-
getQuerySequencesString
Description copied from class:Dialect
Get theselect
command used retrieve the names of all sequences.- Overrides:
getQuerySequencesString
in classDialect
- Returns:
- The select command; or null if sequences are not supported.
-
getSequenceSupport
Description copied from class:MySQLDialect
No support for sequences.- Overrides:
getSequenceSupport
in classMySQLDialect
-
getAggregateSupport
Description copied from class:Dialect
How does this dialect support aggregate types likeSqlTypes.STRUCT
.- Overrides:
getAggregateSupport
in classMySQLDialect
-
getSequenceInformationExtractor
Description copied from class:Dialect
ASequenceInformationExtractor
which is able to extractSequenceInformation
from the JDBC result set returned whenDialect.getQuerySequencesString()
is executed.- Overrides:
getSequenceInformationExtractor
in classDialect
-
getSqlAstTranslatorFactory
Description copied from class:Dialect
- Overrides:
getSqlAstTranslatorFactory
in classMySQLDialect
- See Also:
-
supportsRecursiveCTE
public boolean supportsRecursiveCTE()Description copied from class:Dialect
Does this dialect/database support recursive CTEs?- Overrides:
supportsRecursiveCTE
in classMySQLDialect
- Returns:
true
if recursive CTEs are supported
-
supportsSkipLocked
public boolean supportsSkipLocked()Description copied from class:Dialect
Does this dialect supportSKIP_LOCKED
timeout.- Overrides:
supportsSkipLocked
in classMySQLDialect
- Returns:
true
if SKIP_LOCKED is supported
-
supportsNoWait
public boolean supportsNoWait()Description copied from class:Dialect
Does this dialect supportNO_WAIT
timeout.- Overrides:
supportsNoWait
in classMySQLDialect
- Returns:
true
ifNO_WAIT
is supported
-
supportsWait
public boolean supportsWait()Description copied from class:Dialect
Does this dialect supportWAIT
timeout.- Overrides:
supportsWait
in classMySQLDialect
- Returns:
true
ifWAIT
is supported
-
getReadLockString
Description copied from class:Dialect
Get the string to append toSELECT
statements to acquire READ locks for this dialect.Location of the returned string is treated the same as
Dialect.getForUpdateString()
.- Overrides:
getReadLockString
in classMySQLDialect
- Parameters:
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCK
clause string.
-
getReadLockString
Description copied from class:Dialect
Get the string to append toSELECT
statements 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:
getReadLockString
in classMySQLDialect
- Parameters:
aliases
- The columns to be read locked.timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCK
clause string.
-
getWriteLockString
Description copied from class:Dialect
Get the string to append toSELECT
statements to acquire pessimistic WRITE locks for this dialect.Location of the returned string is treated the same as
Dialect.getForUpdateString()
.- Overrides:
getWriteLockString
in classMySQLDialect
- Parameters:
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate
LOCK
clause string.
-
getForUpdateNowaitString
Description copied from class:Dialect
Retrieves theFOR UPDATE NOWAIT
syntax specific to this dialect.- Overrides:
getForUpdateNowaitString
in classMySQLDialect
- Returns:
- The appropriate
FOR UPDATE NOWAIT
clause string.
-
getForUpdateNowaitString
Description copied from class:Dialect
Get theFOR UPDATE OF column_list NOWAIT
fragment appropriate for this dialect, given the aliases of the columns to be write locked.- Overrides:
getForUpdateNowaitString
in classMySQLDialect
- Parameters:
aliases
- The columns to be write locked.- Returns:
- The appropriate
FOR UPDATE OF colunm_list NOWAIT
clause string.
-
getFunctionalDependencyAnalysisSupport
Description copied from class:Dialect
Get this dialect's level of support for primary key functional dependency analysis withinGROUP BY
andORDER BY
clauses.- Overrides:
getFunctionalDependencyAnalysisSupport
in classMySQLDialect
-
timestampaddPattern
public String timestampaddPattern(TemporalUnit unit, TemporalType temporalType, IntervalType intervalType) Description copied from class:Dialect
Obtain a pattern for the SQL equivalent to atimestampadd()
function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.- Overrides:
timestampaddPattern
in 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
-
getDual
Description copied from class:Dialect
Returns a table expression that has one row.- Overrides:
getDual
in classMySQLDialect
- Returns:
- the SQL equivalent to Oracle's
dual
.
-