public class

SequenceStructure

extends Object
implements DatabaseStructure
java.lang.Object
   ↳ org.hibernate.id.enhanced.SequenceStructure

Class Overview

Describes a sequence.

Summary

Public Constructors
SequenceStructure(Dialect dialect, String sequenceName, int initialValue, int incrementSize, Class numberType)
Public Methods
AccessCallback buildCallback(SessionImplementor session)
A callback to be able to get the next value from the underlying structure as needed.
int getIncrementSize()
The configured increment size
int getInitialValue()
The configured initial value
String getName()
The name of the database structure (table or sequence).
int getTimesAccessed()
How many times has this structure been accessed through this reference?
void prepare(Optimizer optimizer)
Prepare this structure for use.
String[] sqlCreateStrings(Dialect dialect)
Commands needed to create the underlying structures.
String[] sqlDropStrings(Dialect dialect)
Commands needed to drop the underlying structures.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.id.enhanced.DatabaseStructure

Public Constructors

public SequenceStructure (Dialect dialect, String sequenceName, int initialValue, int incrementSize, Class numberType)

Public Methods

public AccessCallback buildCallback (SessionImplementor session)

A callback to be able to get the next value from the underlying structure as needed.

Parameters
session The session.
Returns
  • The next value.

public int getIncrementSize ()

The configured increment size

Returns
  • The configured increment size

public int getInitialValue ()

The configured initial value

Returns
  • The configured initial value

public String getName ()

The name of the database structure (table or sequence).

Returns
  • The structure name.

public int getTimesAccessed ()

How many times has this structure been accessed through this reference?

Returns
  • The number of accesses.

public void prepare (Optimizer optimizer)

Prepare this structure for use. Called sometime after instantiation, but before first use.

Parameters
optimizer The optimizer being applied to the generator.

public String[] sqlCreateStrings (Dialect dialect)

Commands needed to create the underlying structures.

Parameters
dialect The database dialect being used.
Returns
  • The creation commands.

public String[] sqlDropStrings (Dialect dialect)

Commands needed to drop the underlying structures.

Parameters
dialect The database dialect being used.
Returns
  • The drop commands.