Top Description Constructors Methods
org.hibernate.dialect

public Class MariaDB103Dialect

extends MariaDB102Dialect
Class Inheritance
Known Direct Subclasses
org.hibernate.dialect.MariaDB106Dialect
Imports
java.time.Duration, org.hibernate.LockOptions, .MappingException, org.hibernate.dialect.function.StandardSQLFunction, org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorMariaDBDatabaseImpl, org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor, org.hibernate.type.StandardBasicTypes

An SQL dialect for MariaDB 10.3 and later, provides sequence support, lock-timeouts, etc.
Author
Philippe Marschall

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getCreateSequenceString(String
The name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command.
protected String
getCreateSequenceString(String
The name of the sequence
sequenceName
,
int
The initial value to apply to 'create sequence' statement
initialValue
,
int
The increment value to apply to 'create sequence' statement
incrementSize
)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Overloaded form of getCreateSequenceString(String), additionally taking the initial value and increment size to be applied to the sequence definition.
public String
getDropSequenceString(String
The name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getDropSequenceString.

Typically dialects which support sequences can drop a sequence with a single command.
public String
getForUpdateNowaitString()

Overrides org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.
public String
getForUpdateNowaitString(String
The columns to be write locked.
aliases
)

Overrides org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked.
private static long
getLockWaitTimeoutInSeconds(int timeoutInMilliseconds)

public String
getQuerySequencesString()

Overrides org.hibernate.dialect.Dialect.getQuerySequencesString.

Get the select command used retrieve the names of all sequences.
public String
getSelectSequenceNextValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getSelectSequenceNextValString.

Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.
public SequenceInformationExtractor
public String
getSequenceNextValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getSequenceNextValString.

Generate the appropriate select statement to to retrieve the next value of a sequence.
public String
getWriteLockString(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.MySQLDialect.getWriteLockString.

Get the string to append to SELECT statements to acquire WRITE locks for this dialect.
public boolean
supportsPooledSequences()

Overrides org.hibernate.dialect.Dialect.supportsPooledSequences.

Does this dialect support "pooled" sequences.
public boolean
supportsSequences()

Overrides org.hibernate.dialect.Dialect.supportsSequences.

Does this dialect support sequences?
Inherited from org.hibernate.dialect.MariaDB102Dialect:
supportsColumnCheck

Constructor Detail

MariaDB103Dialectback to summary
public MariaDB103Dialect()

Method Detail

getCreateSequenceStringback to summary
public String getCreateSequenceString(String sequenceName)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Doc from org.hibernate.dialect.Dialect.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command. This is convenience form of getCreateSequenceStrings to help facilitate that.

Dialects which support sequences and can create a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to create a sequence should instead override getCreateSequenceStrings.

Parameters
sequenceName:String

The name of the sequence

Returns:String

The sequence creation command

Annotations
@Override
getCreateSequenceStringback to summary
protected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) throws MappingException

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Doc from org.hibernate.dialect.Dialect.getCreateSequenceString.

Overloaded form of getCreateSequenceString(String), additionally taking the initial value and increment size to be applied to the sequence definition.

The default definition is to suffix getCreateSequenceString(String) with the string: " start with {initialValue} increment by {incrementSize}" where {initialValue} and {incrementSize} are replacement placeholders. Generally dialects should only need to override this method if different key phrases are used to apply the allocation information.
Parameters
sequenceName:String

The name of the sequence

initialValue:int

The initial value to apply to 'create sequence' statement

incrementSize:int

The increment value to apply to 'create sequence' statement

Returns:String

The sequence creation command

Annotations
@Override
Exceptions
MappingException:
If sequences are not supported.
getDropSequenceStringback to summary
public String getDropSequenceString(String sequenceName)

Overrides org.hibernate.dialect.Dialect.getDropSequenceString.

Doc from org.hibernate.dialect.Dialect.getDropSequenceString.

Typically dialects which support sequences can drop a sequence with a single command. This is convenience form of getDropSequenceStrings to help facilitate that.

Dialects which support sequences and can drop a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to drop a sequence should instead override getDropSequenceStrings.

Parameters
sequenceName:String

The name of the sequence

Returns:String

The sequence drop commands

Annotations
@Override
getForUpdateNowaitStringback to summary
public String getForUpdateNowaitString()

Overrides org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Doc from org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.

Returns:String

The appropriate FOR UPDATE NOWAIT clause string.

Annotations
@Override
getForUpdateNowaitStringback to summary
public String getForUpdateNowaitString(String aliases)

Overrides org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Doc from org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked.

Parameters
aliases:String

The columns to be write locked.

Returns:String

The appropriate FOR UPDATE OF colunm_list NOWAIT clause string.

Annotations
@Override
getLockWaitTimeoutInSecondsback to summary
private static long getLockWaitTimeoutInSeconds(int timeoutInMilliseconds)
getQuerySequencesStringback to summary
public String getQuerySequencesString()

Overrides org.hibernate.dialect.Dialect.getQuerySequencesString.

Doc from org.hibernate.dialect.Dialect.getQuerySequencesString.

Get the select command used retrieve the names of all sequences.

Returns:String

The select command; or null if sequences are not supported.

Annotations
@Override
getSelectSequenceNextValStringback to summary
public String getSelectSequenceNextValString(String sequenceName)

Overrides org.hibernate.dialect.Dialect.getSelectSequenceNextValString.

Doc from org.hibernate.dialect.Dialect.getSelectSequenceNextValString.

Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.

This differs from getSequenceNextValString(String) in that this should return an expression usable within another statement.

Parameters
sequenceName:String

the name of the sequence

Returns:String

The "nextval" fragment.

Annotations
@Override
getSequenceInformationExtractorback to summary
public SequenceInformationExtractor getSequenceInformationExtractor()

Overrides org.hibernate.dialect.Dialect.getSequenceInformationExtractor.

Annotations
@Override
getSequenceNextValStringback to summary
public String getSequenceNextValString(String sequenceName)

Overrides org.hibernate.dialect.Dialect.getSequenceNextValString.

Doc from org.hibernate.dialect.Dialect.getSequenceNextValString.

Generate the appropriate select statement to to retrieve the next value of a sequence.

This should be a "stand alone" select statement.

Parameters
sequenceName:String

the name of the sequence

Returns:String

String The "nextval" select string.

Annotations
@Override
getWriteLockStringback to summary
public String getWriteLockString(int timeout)

Overrides org.hibernate.dialect.MySQLDialect.getWriteLockString.

Doc from org.hibernate.dialect.Dialect.getWriteLockString.

Get the string to append to SELECT statements to acquire WRITE locks for this dialect. Location of the returned string is treated the same as getForUpdateString.

Parameters
timeout:int

in milliseconds, -1 for indefinite wait and 0 for no wait.

Returns:String

The appropriate LOCK clause string.

Annotations
@Override
supportsPooledSequencesback to summary
public boolean supportsPooledSequences()

Overrides org.hibernate.dialect.Dialect.supportsPooledSequences.

Doc from org.hibernate.dialect.Dialect.supportsPooledSequences.

Does this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?

Returns:boolean

True if such "pooled" sequences are supported; false otherwise.

Annotations
@Override
supportsSequencesback to summary
public boolean supportsSequences()

Overrides org.hibernate.dialect.Dialect.supportsSequences.

Doc from org.hibernate.dialect.Dialect.supportsSequences.

Does this dialect support sequences?

Returns:boolean

True if sequences supported; false otherwise.

Annotations
@Override