Top Description Fields Constructors Methods
org.hibernate.id.enhanced

public Class SequenceStructure

extends Object
implements DatabaseStructure
Class Inheritance
All Implemented Interfaces
org.hibernate.id.enhanced.DatabaseStructure
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, org.slf4j.Logger, .LoggerFactory, org.hibernate.dialect.Dialect, org.hibernate.engine.SessionImplementor, org.hibernate.exception.JDBCExceptionHelper, org.hibernate.HibernateException, org.hibernate.id.IdentifierGeneratorHelper, .IntegralDataTypeHolder

Describes a sequence.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private int
private boolean
private final int
private final int
private static final Logger
private final Class<T>
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
SequenceStructure(Dialect dialect, String sequenceName, int initialValue, int incrementSize, Class<T> numberType)

Method Summary

Modifier and TypeMethod and Description
public AccessCallback
buildCallback(final SessionImplementor
The session.
session
)

Implements org.hibernate.id.enhanced.DatabaseStructure.buildCallback.

A callback to be able to get the next value from the underlying structure as needed.
public int
public int
public String
getName()

Implements org.hibernate.id.enhanced.DatabaseStructure.getName.

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

Implements org.hibernate.id.enhanced.DatabaseStructure.getTimesAccessed.

How many times has this structure been accessed through this reference?
public void
prepare(Optimizer
The optimizer being applied to the generator.
optimizer
)

Implements org.hibernate.id.enhanced.DatabaseStructure.prepare.

Prepare this structure for use.
public String[]
sqlCreateStrings(Dialect
The database dialect being used.
dialect
)

Implements org.hibernate.id.enhanced.DatabaseStructure.sqlCreateStrings.

Commands needed to create the underlying structures.
public String[]
sqlDropStrings(Dialect
The database dialect being used.
dialect
)

Implements org.hibernate.id.enhanced.DatabaseStructure.sqlDropStrings.

Commands needed to drop the underlying structures.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessCounterback to summary
private int accessCounter
applyIncrementSizeToSourceValuesback to summary
private boolean applyIncrementSizeToSourceValues
incrementSizeback to summary
private final int incrementSize
initialValueback to summary
private final int initialValue
logback to summary
private static final Logger log
numberTypeback to summary
private final Class<T> numberType
sequenceNameback to summary
private final String sequenceName
sqlback to summary
private final String sql

Constructor Detail

SequenceStructureback to summary
public SequenceStructure(Dialect dialect, String sequenceName, int initialValue, int incrementSize, Class<T> numberType)

Method Detail

buildCallbackback to summary
public AccessCallback buildCallback(final SessionImplementor session)

Implements org.hibernate.id.enhanced.DatabaseStructure.buildCallback.

Doc from org.hibernate.id.enhanced.DatabaseStructure.buildCallback.

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

Parameters
session:SessionImplementor

The session.

Returns:AccessCallback

The next value.

getIncrementSizeback to summary
public int getIncrementSize()

Implements org.hibernate.id.enhanced.DatabaseStructure.getIncrementSize.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getIncrementSize.

The configured increment size

Returns:int

The configured increment size

getInitialValueback to summary
public int getInitialValue()

Implements org.hibernate.id.enhanced.DatabaseStructure.getInitialValue.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getInitialValue.

The configured initial value

Returns:int

The configured initial value

getNameback to summary
public String getName()

Implements org.hibernate.id.enhanced.DatabaseStructure.getName.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getName.

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

Returns:String

The structure name.

getTimesAccessedback to summary
public int getTimesAccessed()

Implements org.hibernate.id.enhanced.DatabaseStructure.getTimesAccessed.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getTimesAccessed.

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

Returns:int

The number of accesses.

prepareback to summary
public void prepare(Optimizer optimizer)

Implements org.hibernate.id.enhanced.DatabaseStructure.prepare.

Doc from org.hibernate.id.enhanced.DatabaseStructure.prepare.

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

Parameters
optimizer:Optimizer

The optimizer being applied to the generator.

sqlCreateStringsback to summary
public String[] sqlCreateStrings(Dialect dialect) throws HibernateException

Implements org.hibernate.id.enhanced.DatabaseStructure.sqlCreateStrings.

Doc from org.hibernate.id.enhanced.DatabaseStructure.sqlCreateStrings.

Commands needed to create the underlying structures.

Parameters
dialect:Dialect

The database dialect being used.

Returns:String[]

The creation commands.

sqlDropStringsback to summary
public String[] sqlDropStrings(Dialect dialect) throws HibernateException

Implements org.hibernate.id.enhanced.DatabaseStructure.sqlDropStrings.

Doc from org.hibernate.id.enhanced.DatabaseStructure.sqlDropStrings.

Commands needed to drop the underlying structures.

Parameters
dialect:Dialect

The database dialect being used.

Returns:String[]

The drop commands.