public class SequenceStructure extends Object implements DatabaseStructure
Describes a sequence.
| Modifier and Type | Field and Description |
|---|---|
protected String |
sequenceName |
| Constructor and Description |
|---|
SequenceStructure(JdbcEnvironment jdbcEnvironment,
QualifiedName qualifiedSequenceName,
int initialValue,
int incrementSize,
Class numberType) |
| Modifier and Type | Method and Description |
|---|---|
AccessCallback |
buildCallback(SharedSessionContractImplementor session)
A callback to be able to get the next value from the underlying
structure as needed.
|
protected void |
buildSequence(Database database) |
int |
getIncrementSize()
The configured increment size
|
int |
getInitialValue()
The configured initial value
|
String |
getName()
The name of the database structure (table or sequence).
|
protected QualifiedName |
getQualifiedName() |
protected int |
getSourceIncrementSize() |
int |
getTimesAccessed()
How many times has this structure been accessed through this reference?
|
boolean |
isPhysicalSequence()
Is the structure physically a sequence?
|
void |
prepare(Optimizer optimizer)
Prepare this structure for use.
|
void |
registerExportables(Database database)
Register the contained exportable things to the
Database |
String[] |
sqlCreateStrings(Dialect dialect)
Commands needed to create the underlying structures.
|
String[] |
sqlDropStrings(Dialect dialect)
Commands needed to drop the underlying structures.
|
protected String sequenceName
public SequenceStructure(JdbcEnvironment jdbcEnvironment, QualifiedName qualifiedSequenceName, int initialValue, int incrementSize, Class numberType)
public String getName()
DatabaseStructureThe name of the database structure (table or sequence).
getName in interface DatabaseStructurepublic int getIncrementSize()
DatabaseStructureThe configured increment size
getIncrementSize in interface DatabaseStructurepublic int getTimesAccessed()
DatabaseStructureHow many times has this structure been accessed through this reference?
getTimesAccessed in interface DatabaseStructurepublic int getInitialValue()
DatabaseStructureThe configured initial value
getInitialValue in interface DatabaseStructurepublic AccessCallback buildCallback(SharedSessionContractImplementor session)
DatabaseStructureA callback to be able to get the next value from the underlying structure as needed.
buildCallback in interface DatabaseStructuresession - The session.public void prepare(Optimizer optimizer)
DatabaseStructurePrepare this structure for use. Called sometime after instantiation, but before first use.
prepare in interface DatabaseStructureoptimizer - The optimizer being applied to the generator.public void registerExportables(Database database)
ExportableProducerRegister the contained exportable things to the Database
registerExportables in interface ExportableProducerdatabase - The database instancepublic String[] sqlCreateStrings(Dialect dialect) throws HibernateException
DatabaseStructureCommands needed to create the underlying structures.
sqlCreateStrings in interface DatabaseStructuredialect - The database dialect being used.HibernateExceptionpublic String[] sqlDropStrings(Dialect dialect) throws HibernateException
DatabaseStructureCommands needed to drop the underlying structures.
sqlDropStrings in interface DatabaseStructuredialect - The database dialect being used.HibernateExceptionpublic boolean isPhysicalSequence()
DatabaseStructureIs the structure physically a sequence?
isPhysicalSequence in interface DatabaseStructuretrue if the actual database structure is a sequence; false otherwise.protected final int getSourceIncrementSize()
protected QualifiedName getQualifiedName()
protected void buildSequence(Database database)
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.