public class SequenceStructure extends Object implements DatabaseStructure
Modifier and Type | Field and Description |
---|---|
protected QualifiedName |
physicalSequenceName |
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) |
void |
configure(Optimizer optimizer)
Configures this structure with the given arguments.
|
String[] |
getAllSqlForTests() |
int |
getIncrementSize()
The configured increment size
|
int |
getInitialValue()
The configured initial value
|
QualifiedName |
getPhysicalName()
The physical 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?
|
void |
initialize(SqlStringGenerationContext context)
Initializes this structure, in particular pre-generates SQL as necessary.
|
boolean |
isPhysicalSequence()
Is the structure physically a sequence?
|
void |
registerExportables(Database database)
Register database objects involved in this structure, e.g.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
prepare
protected QualifiedName physicalSequenceName
public SequenceStructure(JdbcEnvironment jdbcEnvironment, QualifiedName qualifiedSequenceName, int initialValue, int incrementSize, Class numberType)
public QualifiedName getPhysicalName()
DatabaseStructure
Only available after DatabaseStructure.registerExportables(Database)
has been called.
getPhysicalName
in interface DatabaseStructure
public int getIncrementSize()
DatabaseStructure
getIncrementSize
in interface DatabaseStructure
public int getTimesAccessed()
DatabaseStructure
getTimesAccessed
in interface DatabaseStructure
public int getInitialValue()
DatabaseStructure
getInitialValue
in interface DatabaseStructure
public String[] getAllSqlForTests()
getAllSqlForTests
in interface DatabaseStructure
public AccessCallback buildCallback(SharedSessionContractImplementor session)
DatabaseStructure
buildCallback
in interface DatabaseStructure
session
- The session.public void configure(Optimizer optimizer)
DatabaseStructure
Called just after instantiation, before DatabaseStructure.initialize(SqlStringGenerationContext)
configure
in interface DatabaseStructure
optimizer
- The optimizer being applied to the generator.public void registerExportables(Database database)
DatabaseStructure
This method is called just once, after DatabaseStructure.configure(Optimizer)
,
but before DatabaseStructure.initialize(SqlStringGenerationContext)
.
registerExportables
in interface ExportableProducer
registerExportables
in interface DatabaseStructure
database
- The database instancepublic void initialize(SqlStringGenerationContext context)
DatabaseStructure
This method is called just once, after DatabaseStructure.registerExportables(Database)
,
before first use.
initialize
in interface DatabaseStructure
context
- A context to help generate SQL stringspublic boolean isPhysicalSequence()
DatabaseStructure
isPhysicalSequence
in interface DatabaseStructure
true
if the actual database structure is a sequence; false
otherwise.protected final int getSourceIncrementSize()
protected QualifiedName getQualifiedName()
protected void buildSequence(Database database)
Copyright © 2001-2021 Red Hat, Inc. All Rights Reserved.