Class MySQLLegacyDialect
java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.community.dialect.MySQLLegacyDialect
- All Implemented Interfaces:
org.hibernate.boot.model.FunctionContributor, org.hibernate.boot.model.TypeContributor, org.hibernate.exception.spi.ConversionContext
- Direct Known Subclasses:
MariaDBLegacyDialect
public class MySQLLegacyDialect
extends org.hibernate.dialect.Dialect
A SQL dialect for MySQL 5 and above.
-
Nested Class Summary
Nested classes/interfaces declared in class org.hibernate.dialect.Dialect
org.hibernate.dialect.Dialect.SizeStrategy, org.hibernate.dialect.Dialect.SizeStrategyImpl -
Field Summary
Fields declared in 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
ConstructorsConstructorDescriptionMySQLLegacyDialect(org.hibernate.dialect.DatabaseVersion version) MySQLLegacyDialect(org.hibernate.dialect.DatabaseVersion version, int bytesPerCharacter) MySQLLegacyDialect(org.hibernate.dialect.DatabaseVersion version, int bytesPerCharacter, boolean noBackslashEscapes) MySQLLegacyDialect(org.hibernate.dialect.DatabaseVersion version, org.hibernate.dialect.MySQLServerConfiguration serverConfiguration) MySQLLegacyDialect(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info) -
Method Summary
Modifier and TypeMethodDescriptionappendCheckConstraintOptions(org.hibernate.mapping.CheckConstraint checkConstraint, String sqlCheckConstraint) org.hibernate.engine.jdbc.env.spi.IdentifierHelperbuildIdentifierHelper(org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder builder, DatabaseMetaData metadata) protected org.hibernate.dialect.lock.spi.LockingSupportprotected static org.hibernate.dialect.DatabaseVersioncreateVersion(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info) MySQL 5.7 precision defaults to seconds, but microseconds is betterstatic org.hibernate.dialect.ReplacerdatetimeFormat(String format) extractPattern(org.hibernate.query.common.TemporalUnit unit) MySQL supports a limited list of temporal fields in the extract() function, but we can emulate some of them by using the appropriate named functions instead of extract().protected static intgetCharacterSetBytesPerCharacter(DatabaseMetaData databaseMetaData) Deprecated.protected org.hibernate.dialect.MySQLStorageEnginelongmicrosecondis the smallest unit fortimestampadd()andtimestampdiff(), and the highest precision for atimestamp.org.hibernate.dialect.temptable.TemporaryTableStrategyprotected intMySQL doesn't support thegenerate_seriesfunction orlateralrecursive CTEs, so it has to be emulated with a top level recursive CTE which requires an upper bound on the amount of elements that the series can return.org.hibernate.dialect.DatabaseVersiongetReadLockString(int timeout) getReadLockString(String aliases, int timeout) org.hibernate.dialect.sequence.SequenceSupportNo support for sequences.org.hibernate.dialect.temptable.TemporaryTableKindorg.hibernate.query.sqm.mutation.spi.AfterUseActionorg.hibernate.query.sqm.mutation.spi.BeforeUseActiongetWriteLockString(int timeout) getWriteLockString(String aliases, int timeout) booleanbooleanMySQL strips any trailing space character from a value stored in a column of typechar(n).Methods declared in class org.hibernate.dialect.Dialect
addPartitionKeyToPrimaryKey, addSqlHintOrComment, addUseIndexQueryHint, appendArrayLiteral, appendBinaryLiteral, appendBooleanValueString, appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendIntervalLiteral, appendIntervalLiteral, appendLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildLockingClauseStrategy, buildOptimisticForceIncrementStrategy, buildOptimisticStrategy, buildPessimisticForceIncrementStrategy, buildPessimisticReadStrategy, buildPessimisticWriteStrategy, buildReadStrategy, buildSQLExceptionConversionDelegate, buildStringToBooleanCast, buildStringToBooleanCastDecode, buildStringToBooleanDecode, canBatchTruncate, canCreateCatalog, canCreateSchema, canDisableConstraints, castPattern, castType, causesRollback, checkVersion, closeQuote, columnType, contribute, contributeFunctions, contributeTypes, createOptionalTableUpdateOperation, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestampWithTimeZone, defaultScrollMode, determineDatabaseVersion, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, doesRoundTemporalOnOverflow, dropConstraints, equivalentTypes, escapeComment, forceLobAsLastValue, generatedAs, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAggregateSupport, getAlterColumnTypeString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCatalogSeparator, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckConstraintString, getColumnAliasExtractor, getColumnComment, getColumnDefaultString, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getCurrentSchemaCommand, getCurrentTimestampSelectString, getDefaultDecimalPrecision, getDefaultIntervalSecondScale, getDefaultLobLength, getDefaultNonContextualLobCreation, getDefaultOrdinalityColumnName, getDefaultProperties, getDefaultStatementBatchSize, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintsStatement, getDisableConstraintStatement, getDmlTargetColumnQualifierSupport, getDoublePrecision, getDropCatalogCommand, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropForeignKeyString, getDropSchemaCommand, getDropTableString, getDropUniqueKeyString, getDual, getEnableConstraintsStatement, getEnableConstraintStatement, getEnumTypeDeclaration, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getFloatPrecision, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFromDualForSelectOnly, getFunctionalDependencyAnalysisSupport, getGlobalTemporaryTableStrategy, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIdentityColumnSupport, getIndexExporter, getInExpressionCountLimit, getInformationExtractor, getKeywords, getLimitHandler, getLobMergeStrategy, getLockingClauseStrategy, getLockingStrategy, getLockingStrategy, getLockingSupport, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxIdentifierLength, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxTimestampPrecision, getMaxVarbinaryCapacity, getMaxVarbinaryLength, getMaxVarcharCapacity, getMaxVarcharLength, getMinimumSupportedVersion, getMultiKeyLoadSizingStrategy, getNameQualifierSupport, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNativeValueGenerationStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getNullOrdering, getParameterCountLimit, getPersistentTemporaryTableStrategy, getPessimisticLockStyle, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getQueryHintString, getQuerySequencesString, getReadLockString, getReadLockString, getReadRowLockStrategy, getResultSet, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSelectClauseNullString, getSelectGUIDString, getSequenceExporter, getSequenceInformationExtractor, getSetOperatorSqlString, getSizeStrategy, getSqlAstTranslatorFactory, getSqmTranslatorFactory, getTableCleaner, getTableComment, getTableExporter, getTableMigrator, getTableTypeString, getTemporalTableSupport, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTimeZoneSupport, getTruncateTableStatement, getTruncateTableStatements, getUniqueDelegate, getUniqueKeyExporter, getUserDefinedTypeExporter, getValueLOBFragmentForExtraCreateTableInfo, getVersion, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, getWriteRowLockStrategy, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, initializeFunctionRegistry, isCurrentTimestampSelectStringCallable, isCurrentTimestampStable, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, narrowCastType, openQuote, ordinal, prependComment, qualifyIndexName, quote, quoteCollation, registerColumnTypes, registerDefaultKeywords, registerKeyword, registerKeywords, registerResultSetOutParameter, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, requiresColumnListInCreateView, requiresFloatCastingOfIntegerDivision, requiresNotNullBeforeDefault, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeDescriptor, resolveSqlTypeLength, roundsToMaxPrecisionFirst, rowId, rowIdSqlType, supportsAlterColumnType, supportsArrayConstructor, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBindingNullForSetObject, supportsBindingNullSqlTypeForSetNull, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsConflictClauseForInsertCTE, supportsCrossJoin, supportsCteHeaderColumnList, supportsCurrentTimestampSelection, supportsDistinctFromPredicate, supportsDuplicateSelectItemsInQueryGroup, supportsExceptAll, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFilterClause, supportsForUpdate, supportsFractionalTimestampArithmetic, supportsFromClauseInUpdate, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeIndexName, supportsIfExistsBeforeTableName, supportsIfExistsBeforeTypeName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsInsertReturningRowId, supportsIntersect, supportsIsTrue, supportsJdbcConnectionLobCreation, supportsJoinInMutationStatementSubquery, supportsJoinsInDelete, supportsLateral, supportsLobValueChangePropagation, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNamedColumnCheck, supportsNamedParameters, supportsNationalizedMethods, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNotNullAfterGeneratedAs, supportsNoWait, supportsNullPrecedence, supportsOffsetInSubquery, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsPartitionBy, supportsPredicateAsExpression, supportsRecursiveCTE, supportsRecursiveCycleClause, supportsRecursiveCycleUsingClause, supportsRecursiveSearchClause, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowConstructor, supportsRowValueConstructorDistinctFromSyntax, supportsRowValueConstructorGtLtSyntax, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInInSubQuery, supportsRowValueConstructorSyntaxInQuantifiedPredicates, supportsSimpleQueryGrouping, supportsSkipLocked, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTableOptions, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUniqueConstraints, supportsUpdateReturning, supportsUserDefinedTypes, supportsValueLOBAccess, supportsValuesList, supportsValuesListForInsert, supportsWait, supportsWindowFunctions, supportsWithClause, supportsWithClauseInSubquery, throttleDdl, timestampaddPattern, timestampdiffPattern, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useConnectionToCreateLob, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob, useMaterializedLobWhenCapacityExceeded
-
Constructor Details
-
MySQLLegacyDialect
public MySQLLegacyDialect() -
MySQLLegacyDialect
public MySQLLegacyDialect(org.hibernate.dialect.DatabaseVersion version) -
MySQLLegacyDialect
public MySQLLegacyDialect(org.hibernate.dialect.DatabaseVersion version, int bytesPerCharacter) -
MySQLLegacyDialect
public MySQLLegacyDialect(org.hibernate.dialect.DatabaseVersion version, org.hibernate.dialect.MySQLServerConfiguration serverConfiguration) -
MySQLLegacyDialect
public MySQLLegacyDialect(org.hibernate.dialect.DatabaseVersion version, int bytesPerCharacter, boolean noBackslashEscapes) -
MySQLLegacyDialect
public MySQLLegacyDialect(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info)
-
-
Method Details
-
createVersion
protected static org.hibernate.dialect.DatabaseVersion createVersion(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info) -
buildLockingSupport
protected org.hibernate.dialect.lock.spi.LockingSupport buildLockingSupport() -
stripsTrailingSpacesFromChar
public boolean stripsTrailingSpacesFromChar()MySQL strips any trailing space character from a value stored in a column of typechar(n).- Overrides:
stripsTrailingSpacesFromCharin classorg.hibernate.dialect.Dialect- Returns:
true
-
getCharacterSetBytesPerCharacter
@Deprecated protected static int getCharacterSetBytesPerCharacter(DatabaseMetaData databaseMetaData) Deprecated. -
isNoBackslashEscapesEnabled
public boolean isNoBackslashEscapesEnabled() -
getMySQLVersion
public org.hibernate.dialect.DatabaseVersion getMySQLVersion() -
getMaximumSeriesSize
protected int getMaximumSeriesSize()MySQL doesn't support thegenerate_seriesfunction orlateralrecursive CTEs, so it has to be emulated with a top level recursive CTE which requires an upper bound on the amount of elements that the series can return. -
currentTimestamp
MySQL 5.7 precision defaults to seconds, but microseconds is better- Overrides:
currentTimestampin classorg.hibernate.dialect.Dialect
-
getFractionalSecondPrecisionInNanos
public long getFractionalSecondPrecisionInNanos()microsecondis the smallest unit fortimestampadd()andtimestampdiff(), and the highest precision for atimestamp.- Overrides:
getFractionalSecondPrecisionInNanosin classorg.hibernate.dialect.Dialect
-
extractPattern
MySQL supports a limited list of temporal fields in the extract() function, but we can emulate some of them by using the appropriate named functions instead of extract(). Thus, the additional supported fields areTemporalUnit.DAY_OF_YEAR,TemporalUnit.DAY_OF_MONTH,TemporalUnit.DAY_OF_YEAR. In addition, the fieldTemporalUnit.SECONDis redefined to include microseconds.- Overrides:
extractPatternin classorg.hibernate.dialect.Dialect
-
getSequenceSupport
public org.hibernate.dialect.sequence.SequenceSupport getSequenceSupport()No support for sequences.- Overrides:
getSequenceSupportin classorg.hibernate.dialect.Dialect
-
getLocalTemporaryTableStrategy
public org.hibernate.dialect.temptable.TemporaryTableStrategy getLocalTemporaryTableStrategy()- Overrides:
getLocalTemporaryTableStrategyin classorg.hibernate.dialect.Dialect
-
getSupportedTemporaryTableKind
public org.hibernate.dialect.temptable.TemporaryTableKind getSupportedTemporaryTableKind()- Overrides:
getSupportedTemporaryTableKindin classorg.hibernate.dialect.Dialect
-
getTemporaryTableCreateCommand
- Overrides:
getTemporaryTableCreateCommandin classorg.hibernate.dialect.Dialect
-
getTemporaryTableDropCommand
- Overrides:
getTemporaryTableDropCommandin classorg.hibernate.dialect.Dialect
-
getTemporaryTableAfterUseAction
public org.hibernate.query.sqm.mutation.spi.AfterUseAction getTemporaryTableAfterUseAction()- Overrides:
getTemporaryTableAfterUseActionin classorg.hibernate.dialect.Dialect
-
getTemporaryTableBeforeUseAction
public org.hibernate.query.sqm.mutation.spi.BeforeUseAction getTemporaryTableBeforeUseAction()- Overrides:
getTemporaryTableBeforeUseActionin classorg.hibernate.dialect.Dialect
-
buildIdentifierHelper
public org.hibernate.engine.jdbc.env.spi.IdentifierHelper buildIdentifierHelper(org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder builder, DatabaseMetaData metadata) throws SQLException - Overrides:
buildIdentifierHelperin classorg.hibernate.dialect.Dialect- Throws:
SQLException
-
getDefaultMySQLStorageEngine
protected org.hibernate.dialect.MySQLStorageEngine getDefaultMySQLStorageEngine() -
datetimeFormat
-
getWriteLockString
- Overrides:
getWriteLockStringin classorg.hibernate.dialect.Dialect
-
getWriteLockString
-
getReadLockString
- Overrides:
getReadLockStringin classorg.hibernate.dialect.Dialect
-
getReadLockString
-
appendCheckConstraintOptions
-