Top Description Fields Constructors Methods
org.hibernate.dialect.sequence

public final Class MariaDBSequenceSupport

extends ANSISequenceSupport
Class Inheritance
Imports
org.hibernate.MappingException

Sequence support for org.hibernate.dialect.MariaDBDialect.
Author
Christian Beikov

Field Summary

Modifier and TypeField and Description
public static final SequenceSupport

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Overrides default org.hibernate.dialect.sequence.SequenceSupport.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command.
public 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 default org.hibernate.dialect.sequence.SequenceSupport.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command.
public String
getSelectSequencePreviousValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.sequence.ANSISequenceSupport.getSelectSequencePreviousValString.

Overrides default org.hibernate.dialect.sequence.SequenceSupport.getSelectSequencePreviousValString.

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

Overrides default org.hibernate.dialect.sequence.SequenceSupport.sometimesNeedsStartingValue.

Do we need to explicitly specify minvalue or maxvalue when the initial value doesn't have the same sign as the increment?
Inherited from org.hibernate.dialect.sequence.ANSISequenceSupport:
getSelectSequenceNextValString

Field Detail

INSTANCEback to summary
public static final SequenceSupport INSTANCE

Hides org.hibernate.dialect.sequence.ANSISequenceSupport.INSTANCE.

Constructor Detail

MariaDBSequenceSupportback to summary
public MariaDBSequenceSupport()

Method Detail

getCreateSequenceStringback to summary
public String getCreateSequenceString(String sequenceName) throws MappingException

Overrides default org.hibernate.dialect.sequence.SequenceSupport.getCreateSequenceString.

Doc from org.hibernate.dialect.sequence.SequenceSupport.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command. This method is a convenience making it easier to implement getCreateSequenceStrings(String, int, int) for these dialects.

The default definition is to return create sequence sequenceName for the argument sequenceName. Dialects need to override this method if a sequence created in this manner does not start at 1, or if the syntax is nonstandard.

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 override getCreateSequenceStrings(String, int, int) instead.

Parameters
sequenceName:String

The name of the sequence

Returns:String

The sequence creation command

Annotations
@Override
Exceptions
MappingException:
If sequences are not supported.
getCreateSequenceStringback to summary
public String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) throws MappingException

Overrides default org.hibernate.dialect.sequence.SequenceSupport.getCreateSequenceString.

Doc from org.hibernate.dialect.sequence.SequenceSupport.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command. This method is a convenience making it easier to implement getCreateSequenceStrings(String, int, int) for these dialects.

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 for the arguments initialValue and incrementSize. Dialects 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.
getSelectSequencePreviousValStringback to summary
public String getSelectSequencePreviousValString(String sequenceName) throws MappingException

Overrides org.hibernate.dialect.sequence.ANSISequenceSupport.getSelectSequencePreviousValString.

Overrides default org.hibernate.dialect.sequence.SequenceSupport.getSelectSequencePreviousValString.

Doc from org.hibernate.dialect.sequence.SequenceSupport.getSelectSequencePreviousValString.

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

This differs from getSequencePreviousValString(String) in that it must return an expression usable within another statement.

Parameters
sequenceName:String

the name of the sequence

Returns:String

The "previous value" fragment.

Annotations
@Override
Exceptions
MappingException:
If sequences are not supported.
sometimesNeedsStartingValueback to summary
public boolean sometimesNeedsStartingValue()

Overrides default org.hibernate.dialect.sequence.SequenceSupport.sometimesNeedsStartingValue.

Doc from org.hibernate.dialect.sequence.SequenceSupport.sometimesNeedsStartingValue.

Do we need to explicitly specify minvalue or maxvalue when the initial value doesn't have the same sign as the increment?

Annotations
@Override