public class

TableStructure

extends TransactionHelper
implements DatabaseStructure
java.lang.Object
   ↳ org.hibernate.engine.TransactionHelper
     ↳ org.hibernate.id.enhanced.TableStructure

Class Overview

Describes a table used to mimic sequence behavior

Summary

Public Constructors
TableStructure(Dialect dialect, String tableName, String valueColumnName, 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.
Protected Methods
Serializable doWorkInCurrentTransaction(Connection conn, String sql)
The work to be done
[Expand]
Inherited Methods
From class org.hibernate.engine.TransactionHelper
From class java.lang.Object
From interface org.hibernate.id.enhanced.DatabaseStructure

Public Constructors

public TableStructure (Dialect dialect, String tableName, String valueColumnName, 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.

Protected Methods

protected Serializable doWorkInCurrentTransaction (Connection conn, String sql)

The work to be done

Throws
SQLException