Package org.hibernate.dialect
Class MariaDBDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.MySQLDialect
-
- org.hibernate.dialect.MariaDBDialect
-
- All Implemented Interfaces:
ConversionContext
- Direct Known Subclasses:
MariaDB102Dialect
,MariaDB103Dialect
,MariaDB10Dialect
,MariaDB53Dialect
public class MariaDBDialect extends MySQLDialect
A SQL dialect for MariaDB
-
-
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 MariaDBDialect()
MariaDBDialect(DatabaseVersion version)
MariaDBDialect(DialectResolutionInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdentifierHelper
buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData)
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.protected MySQLStorageEngine
getDefaultMySQLStorageEngine()
DatabaseVersion
getMySQLVersion()
NationalizationSupport
getNationalizationSupport()
Determines whether this database requires the use of explicit nationalized character data types.String
getQuerySequencesString()
Get the select command used retrieve the names of all sequences.SequenceInformationExtractor
getSequenceInformationExtractor()
A source ofSequenceInformation
.SequenceSupport
getSequenceSupport()
No support for sequences.SqlAstTranslatorFactory
getSqlAstTranslatorFactory()
Return an SqlAstTranslatorFactory specific for the Dialect.void
initializeFunctionRegistry(QueryEngine queryEngine)
Initialize the given registry with any dialect-specific functions.boolean
supportsColumnCheck()
Does this dialect support column-level check constraints?boolean
supportsIfExistsAfterAlterTable()
For an "alter table", can the phrase "if exists" be applied?boolean
supportsIfExistsBeforeConstraintName()
For dropping a constraint with an "alter table", can the phrase "if exists" be applied before the constraint name?boolean
supportsNoWait()
Does this dialect/database support NO_WAIT timeout.boolean
supportsSkipLocked()
Does this dialect/database support SKIP_LOCKED timeout.boolean
supportsWait()
Does this dialect/database support WAIT timeout.boolean
supportsWindowFunctions()
Does this dialect support window functions likerow_number() over (..)
?-
Methods inherited from class org.hibernate.dialect.MySQLDialect
appendDatetimeFormat, appendLiteral, buildSQLExceptionConversionDelegate, canCreateCatalog, canCreateSchema, castPattern, castType, closeQuote, columnType, contributeTypes, createVersion, currentTimestamp, datetimeFormat, dropConstraints, extractPattern, getAddForeignKeyConstraintString, getCharacterSetBytesPerCharacter, getColumnComment, getCreateCatalogCommand, getCreateSchemaCommand, getCurrentTimestampSelectString, getDefaultLobLength, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getFloatPrecision, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getFractionalSecondPrecisionInNanos, getGroupBySelectItemReferenceStrategy, getIdentityColumnSupport, getLimitHandler, getMaxAliasLength, getMaxIdentifierLength, getMaxVarbinaryLength, getMaxVarcharLength, getMinimumSupportedVersion, getNameQualifierSupport, getNullColumnString, getNullOrdering, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getReadLockString, getReadLockString, getResultSet, getSelectGUIDString, getSizeStrategy, getSupportedTemporaryTableKind, getTableComment, getTableTypeString, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableDropCommand, getUniqueDelegate, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, getWriteRowLockStrategy, hasSelfReferentialForeignKeyBug, initDefaultProperties, isCurrentTimestampSelectStringCallable, isJdbcLogWarningsEnabledByDefault, isNoBackslashEscapesEnabled, openQuote, qualifyIndexName, registerColumnTypes, registerResultSetOutParameter, resolveSqlTypeDescriptor, supportsCascadeDelete, supportsCurrentTimestampSelection, supportsIfExistsBeforeTableName, supportsLateral, supportsLobValueChangePropagation, supportsLockTimeouts, supportsNullPrecedence, supportsOffsetInSubquery, supportsSubqueryOnMutatingTable, supportsUnionAll, timestampaddPattern, timestampdiffPattern
-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendArrayLiteral, appendBinaryLiteral, appendBooleanValueString, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendIntervalLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, checkVersion, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestampWithTimeZone, defaultScrollMode, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, equivalentTypes, escapeComment, forceLobAsLastValue, generatedAs, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBooleanCheckCondition, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getColumnAliasExtractor, getCreateMultisetTableString, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCurrentSchemaCommand, getDefaultBatchLoadSizingStrategy, getDefaultDecimalPrecision, getDefaultNonContextualLobCreation, getDefaultProperties, getDefaultStatementBatchSize, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDoublePrecision, getDropTableString, getEnumCheckCondition, getForeignKeyExporter, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getHqlTranslator, getIndexExporter, getInExpressionCountLimit, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxNVarcharLength, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNullColumnString, getPreferredSqlTypeCodeForArray, getQueryHintString, getReadRowLockStrategy, getResultSet, getResultSet, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSqmTranslatorFactory, getTableExporter, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeZoneSupport, getUniqueKeyExporter, getVersion, hasAlterTable, hasDataTypeBeforeGeneratedAs, inlineLiteral, isAnsiNullOn, isEmptyStringTreatedAsNull, isLockTimeoutParameterized, prependComment, quote, registerDefaultKeywords, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeLength, supportsBindAsCallableArgument, supportsBitType, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsCommentOn, supportsDistinctFromPredicate, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFractionalTimestampArithmetic, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsJdbcConnectionLobCreation, supportsNamedParameters, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsStandardArrays, supportsSubqueryInSelect, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionInSubquery, supportsValuesList, supportsValuesListForInsert, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, useFollowOnLocking, useInputStreamToInsertBlob
-
-
-
-
Constructor Detail
-
MariaDBDialect
public MariaDBDialect()
-
MariaDBDialect
public MariaDBDialect(DatabaseVersion version)
-
MariaDBDialect
public MariaDBDialect(DialectResolutionInfo info)
-
-
Method Detail
-
getMySQLVersion
public DatabaseVersion getMySQLVersion()
- Overrides:
getMySQLVersion
in classMySQLDialect
-
getNationalizationSupport
public NationalizationSupport getNationalizationSupport()
Description copied from class:Dialect
Determines whether this database requires the use of explicit nationalized character data types.That is, whether the use of
Types.NCHAR
,Types.NVARCHAR
, andTypes.NCLOB
is required for nationalized character data (Unicode).- Overrides:
getNationalizationSupport
in classDialect
-
initializeFunctionRegistry
public void initializeFunctionRegistry(QueryEngine queryEngine)
Description copied from class:Dialect
Initialize the given registry with any dialect-specific functions.Support for certain SQL functions is required, and if the database does not support a required function, then the dialect must define a way to emulate it.
These required functions include the functions defined by the JPA query language specification:
- avg(arg) - aggregate function
- count([distinct ]arg) - aggregate function
- max(arg) - aggregate function
- min(arg) - aggregate function
- sum(arg) - aggregate function
- coalesce(arg0, arg1, ...)
- nullif(arg0, arg1)
- lower(arg)
- upper(arg)
- length(arg)
- concat(arg0, arg1, ...)
- locate(pattern, string[, start])
- substring(string, start[, length])
- trim([[spec ][character ]from] string)
- abs(arg)
- mod(arg0, arg1)
- sqrt(arg)
- current date
- current time
- current timestamp
- any(arg) - aggregate function
- every(arg) - aggregate function
- cast(arg as Type)
- extract(field from arg)
- ln(arg)
- exp(arg)
- power(arg0, arg1)
- floor(arg)
- ceiling(arg)
- position(pattern in string)
- substring(string from start[ for length])
- overlay(string placing replacement from start[ for length])
- local date
- local time
- local datetime
- offset datetime
- instant
- left(string, length)
- right(string, length)
- replace(string, pattern, replacement)
- pad(string with length spec[ character])
- log10(arg)
- sign(arg)
- sin(arg)
- cos(arg)
- tan(arg)
- asin(arg)
- acos(arg)
- atan(arg)
- atan2(arg0, arg1)
- round(arg0, arg1)
- least(arg0, arg1, ...)
- greatest(arg0, arg1, ...)
- format(datetime as pattern)
- collate(string as collation)
- str(arg) - synonym of cast(a as String)
- ifnull(arg0, arg1) - synonym of coalesce(a, b)
- second(arg) - synonym of extract(second from a)
- minute(arg) - synonym of extract(minute from a)
- hour(arg) - synonym of extract(hour from a)
- day(arg) - synonym of extract(day from a)
- month(arg) - synonym of extract(month from a)
- year(arg) - synonym of extract(year from a)
- Overrides:
initializeFunctionRegistry
in classMySQLDialect
-
getSqlAstTranslatorFactory
public SqlAstTranslatorFactory getSqlAstTranslatorFactory()
Description copied from class:Dialect
Return an SqlAstTranslatorFactory specific for the Dialect. Returnnull
to use Hibernate's standard translator.- Overrides:
getSqlAstTranslatorFactory
in classMySQLDialect
- See Also:
StandardSqlAstTranslatorFactory
,JdbcEnvironment.getSqlAstTranslatorFactory()
-
supportsWindowFunctions
public boolean supportsWindowFunctions()
Description copied from class:Dialect
Does this dialect support window functions likerow_number() over (..)
?- Overrides:
supportsWindowFunctions
in classMySQLDialect
- Returns:
true
if the underlying database supports window functions,false
otherwise. The default isfalse
.
-
supportsColumnCheck
public boolean supportsColumnCheck()
Description copied from class:Dialect
Does this dialect support column-level check constraints?- Overrides:
supportsColumnCheck
in classMySQLDialect
- Returns:
- True if column-level CHECK constraints are supported; false otherwise.
-
getDefaultMySQLStorageEngine
protected MySQLStorageEngine getDefaultMySQLStorageEngine()
- Overrides:
getDefaultMySQLStorageEngine
in classMySQLDialect
-
supportsIfExistsBeforeConstraintName
public boolean supportsIfExistsBeforeConstraintName()
Description copied from class:Dialect
For dropping a constraint with an "alter table", can the phrase "if exists" be applied before the constraint name? NOTE : Only one or the other (or neither) of this andDialect.supportsIfExistsAfterConstraintName()
should return true- Overrides:
supportsIfExistsBeforeConstraintName
in classDialect
- Returns:
true
if the "if exists" can be applied before the constraint name
-
supportsIfExistsAfterAlterTable
public boolean supportsIfExistsAfterAlterTable()
Description copied from class:Dialect
For an "alter table", can the phrase "if exists" be applied?- Overrides:
supportsIfExistsAfterAlterTable
in classDialect
- Returns:
true
if the "if exists" can be applied after ALTER TABLE
-
getSequenceSupport
public SequenceSupport getSequenceSupport()
Description copied from class:MySQLDialect
No support for sequences.- Overrides:
getSequenceSupport
in classMySQLDialect
-
getQuerySequencesString
public String getQuerySequencesString()
Description copied from class:Dialect
Get the select command used retrieve the names of all sequences.- Overrides:
getQuerySequencesString
in classDialect
- Returns:
- The select command; or null if sequences are not supported.
-
getSequenceInformationExtractor
public SequenceInformationExtractor getSequenceInformationExtractor()
Description copied from class:Dialect
A source ofSequenceInformation
.- Overrides:
getSequenceInformationExtractor
in classDialect
-
supportsSkipLocked
public boolean supportsSkipLocked()
Description copied from class:Dialect
Does this dialect/database support SKIP_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/database support NO_WAIT timeout.- Overrides:
supportsNoWait
in classMySQLDialect
- Returns:
true
if NO_WAIT is supported
-
supportsWait
public boolean supportsWait()
Description copied from class:Dialect
Does this dialect/database support WAIT timeout.- Overrides:
supportsWait
in classMySQLDialect
- Returns:
true
if WAIT is supported
-
buildIdentifierHelper
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException
Description copied from class:Dialect
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions. Returningnull
is allowed and indicates that Hibernate should fallback to building a "standard" helper. In the fallback path, any changes made to the IdentifierHelperBuilder during this call will still be incorporated into the built IdentifierHelper. The incoming builder will have the following set:IdentifierHelperBuilder.isGloballyQuoteIdentifiers()
IdentifierHelperBuilder.getUnquotedCaseStrategy()
- initialized to UPPERIdentifierHelperBuilder.getQuotedCaseStrategy()
- initialized to MIXED
- Call
IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
- Call
IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
- Applies
AnsiSqlKeywords.sql2003()
as reserved words - Applies the {#link #sqlKeywords} collected here as reserved words
- Applies the Dialect's NameQualifierSupport, if it defines one
- Overrides:
buildIdentifierHelper
in classMySQLDialect
- Parameters:
builder
- A semi-configured IdentifierHelper builder.dbMetaData
- Access to the metadata returned from the driver if needed and if available. WARNING: may benull
- Returns:
- The IdentifierHelper instance to use, or
null
to indicate Hibernate should use its fallback path - Throws:
SQLException
- Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.- See Also:
Dialect.getNameQualifierSupport()
-
-