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

    Constructors
    Constructor
    Description
     
    MySQLLegacyDialect(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 Type
    Method
    Description
    appendCheckConstraintOptions(org.hibernate.mapping.CheckConstraint checkConstraint, String sqlCheckConstraint)
     
    org.hibernate.engine.jdbc.env.spi.IdentifierHelper
    buildIdentifierHelper(org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder builder, DatabaseMetaData metadata)
     
    protected org.hibernate.dialect.lock.spi.LockingSupport
     
    protected static org.hibernate.dialect.DatabaseVersion
    createVersion(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info)
     
    MySQL 5.7 precision defaults to seconds, but microseconds is better
    static org.hibernate.dialect.Replacer
     
    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 int
    Deprecated.
    protected org.hibernate.dialect.MySQLStorageEngine
     
    long
    microsecond is the smallest unit for timestampadd() and timestampdiff(), and the highest precision for a timestamp.
    org.hibernate.dialect.temptable.TemporaryTableStrategy
     
    protected int
    MySQL doesn't support the generate_series function or lateral recursive 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.DatabaseVersion
     
    getReadLockString(int timeout)
     
    getReadLockString(String aliases, int timeout)
     
    org.hibernate.dialect.sequence.SequenceSupport
    No support for sequences.
    org.hibernate.dialect.temptable.TemporaryTableKind
     
    org.hibernate.query.sqm.mutation.spi.AfterUseAction
     
    org.hibernate.query.sqm.mutation.spi.BeforeUseAction
     
     
     
    getWriteLockString(int timeout)
     
    getWriteLockString(String aliases, int timeout)
     
    boolean
     
    boolean
    MySQL strips any trailing space character from a value stored in a column of type char(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

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 type char(n).
      Overrides:
      stripsTrailingSpacesFromChar in class org.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 the generate_series function or lateral recursive 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

      public String currentTimestamp()
      MySQL 5.7 precision defaults to seconds, but microseconds is better
      Overrides:
      currentTimestamp in class org.hibernate.dialect.Dialect
    • getFractionalSecondPrecisionInNanos

      public long getFractionalSecondPrecisionInNanos()
      microsecond is the smallest unit for timestampadd() and timestampdiff(), and the highest precision for a timestamp.
      Overrides:
      getFractionalSecondPrecisionInNanos in class org.hibernate.dialect.Dialect
    • extractPattern

      public String 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(). Thus, the additional supported fields are TemporalUnit.DAY_OF_YEAR, TemporalUnit.DAY_OF_MONTH, TemporalUnit.DAY_OF_YEAR. In addition, the field TemporalUnit.SECOND is redefined to include microseconds.
      Overrides:
      extractPattern in class org.hibernate.dialect.Dialect
    • getSequenceSupport

      public org.hibernate.dialect.sequence.SequenceSupport getSequenceSupport()
      No support for sequences.
      Overrides:
      getSequenceSupport in class org.hibernate.dialect.Dialect
    • getLocalTemporaryTableStrategy

      public org.hibernate.dialect.temptable.TemporaryTableStrategy getLocalTemporaryTableStrategy()
      Overrides:
      getLocalTemporaryTableStrategy in class org.hibernate.dialect.Dialect
    • getSupportedTemporaryTableKind

      public org.hibernate.dialect.temptable.TemporaryTableKind getSupportedTemporaryTableKind()
      Overrides:
      getSupportedTemporaryTableKind in class org.hibernate.dialect.Dialect
    • getTemporaryTableCreateCommand

      public String getTemporaryTableCreateCommand()
      Overrides:
      getTemporaryTableCreateCommand in class org.hibernate.dialect.Dialect
    • getTemporaryTableDropCommand

      public String getTemporaryTableDropCommand()
      Overrides:
      getTemporaryTableDropCommand in class org.hibernate.dialect.Dialect
    • getTemporaryTableAfterUseAction

      public org.hibernate.query.sqm.mutation.spi.AfterUseAction getTemporaryTableAfterUseAction()
      Overrides:
      getTemporaryTableAfterUseAction in class org.hibernate.dialect.Dialect
    • getTemporaryTableBeforeUseAction

      public org.hibernate.query.sqm.mutation.spi.BeforeUseAction getTemporaryTableBeforeUseAction()
      Overrides:
      getTemporaryTableBeforeUseAction in class org.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:
      buildIdentifierHelper in class org.hibernate.dialect.Dialect
      Throws:
      SQLException
    • getDefaultMySQLStorageEngine

      protected org.hibernate.dialect.MySQLStorageEngine getDefaultMySQLStorageEngine()
    • datetimeFormat

      public static org.hibernate.dialect.Replacer datetimeFormat(String format)
    • getWriteLockString

      public String getWriteLockString(int timeout)
      Overrides:
      getWriteLockString in class org.hibernate.dialect.Dialect
    • getWriteLockString

      public String getWriteLockString(String aliases, int timeout)
      Overrides:
      getWriteLockString in class org.hibernate.dialect.Dialect
    • getReadLockString

      public String getReadLockString(int timeout)
      Overrides:
      getReadLockString in class org.hibernate.dialect.Dialect
    • getReadLockString

      public String getReadLockString(String aliases, int timeout)
      Overrides:
      getReadLockString in class org.hibernate.dialect.Dialect
    • appendCheckConstraintOptions

      public String appendCheckConstraintOptions(org.hibernate.mapping.CheckConstraint checkConstraint, String sqlCheckConstraint)
      Overrides:
      appendCheckConstraintOptions in class org.hibernate.dialect.Dialect