Package org.hibernate.id.enhanced
Class SequenceStructure
- java.lang.Object
-
- org.hibernate.id.enhanced.SequenceStructure
-
- All Implemented Interfaces:
ExportableProducer,DatabaseStructure
public class SequenceStructure extends java.lang.Object implements DatabaseStructure
Describes a sequence.
-
-
Field Summary
Fields Modifier and Type Field Description protected QualifiedNamephysicalSequenceName
-
Constructor Summary
Constructors Constructor Description SequenceStructure(JdbcEnvironment jdbcEnvironment, QualifiedName qualifiedSequenceName, int initialValue, int incrementSize, java.lang.Class numberType)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AccessCallbackbuildCallback(SharedSessionContractImplementor session)A callback to be able to get the next value from the underlying structure as needed.protected voidbuildSequence(Database database)voidconfigure(Optimizer optimizer)Configures this structure with the given arguments.java.lang.String[]getAllSqlForTests()intgetIncrementSize()The configured increment sizeintgetInitialValue()The configured initial valuejava.lang.StringgetName()Deprecated.QualifiedNamegetPhysicalName()The physical name of the database structure (table or sequence).protected QualifiedNamegetQualifiedName()protected intgetSourceIncrementSize()intgetTimesAccessed()How many times has this structure been accessed through this reference?voidinitialize(SqlStringGenerationContext context)Initializes this structure, in particular pre-generates SQL as necessary.booleanisPhysicalSequence()Is the structure physically a sequence?voidregisterExportables(Database database)Register database objects involved in this structure, e.g.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.id.enhanced.DatabaseStructure
prepare
-
-
-
-
Field Detail
-
physicalSequenceName
protected QualifiedName physicalSequenceName
-
-
Constructor Detail
-
SequenceStructure
public SequenceStructure(JdbcEnvironment jdbcEnvironment, QualifiedName qualifiedSequenceName, int initialValue, int incrementSize, java.lang.Class numberType)
-
-
Method Detail
-
getName
@Deprecated public java.lang.String getName()
Deprecated.Description copied from interface:DatabaseStructureThe name of the database structure (table or sequence).- Specified by:
getNamein interfaceDatabaseStructure
-
getPhysicalName
public QualifiedName getPhysicalName()
Description copied from interface:DatabaseStructureThe physical name of the database structure (table or sequence).Only available after
DatabaseStructure.registerExportables(Database)has been called.- Specified by:
getPhysicalNamein interfaceDatabaseStructure- Returns:
- The structure name.
-
getIncrementSize
public int getIncrementSize()
Description copied from interface:DatabaseStructureThe configured increment size- Specified by:
getIncrementSizein interfaceDatabaseStructure- Returns:
- The configured increment size
-
getTimesAccessed
public int getTimesAccessed()
Description copied from interface:DatabaseStructureHow many times has this structure been accessed through this reference?- Specified by:
getTimesAccessedin interfaceDatabaseStructure- Returns:
- The number of accesses.
-
getInitialValue
public int getInitialValue()
Description copied from interface:DatabaseStructureThe configured initial value- Specified by:
getInitialValuein interfaceDatabaseStructure- Returns:
- The configured initial value
-
getAllSqlForTests
public java.lang.String[] getAllSqlForTests()
- Specified by:
getAllSqlForTestsin interfaceDatabaseStructure
-
buildCallback
public AccessCallback buildCallback(SharedSessionContractImplementor session)
Description copied from interface:DatabaseStructureA callback to be able to get the next value from the underlying structure as needed.- Specified by:
buildCallbackin interfaceDatabaseStructure- Parameters:
session- The session.- Returns:
- The next value.
-
configure
public void configure(Optimizer optimizer)
Description copied from interface:DatabaseStructureConfigures this structure with the given arguments.Called just after instantiation, before
DatabaseStructure.initialize(SqlStringGenerationContext)- Specified by:
configurein interfaceDatabaseStructure- Parameters:
optimizer- The optimizer being applied to the generator.
-
registerExportables
public void registerExportables(Database database)
Description copied from interface:DatabaseStructureRegister database objects involved in this structure, e.g. sequences, tables, etc.This method is called just once, after
DatabaseStructure.configure(Optimizer), but beforeDatabaseStructure.initialize(SqlStringGenerationContext).- Specified by:
registerExportablesin interfaceDatabaseStructure- Specified by:
registerExportablesin interfaceExportableProducer- Parameters:
database- The database instance
-
initialize
public void initialize(SqlStringGenerationContext context)
Description copied from interface:DatabaseStructureInitializes this structure, in particular pre-generates SQL as necessary.This method is called just once, after
DatabaseStructure.registerExportables(Database), before first use.- Specified by:
initializein interfaceDatabaseStructure- Parameters:
context- A context to help generate SQL strings
-
isPhysicalSequence
public boolean isPhysicalSequence()
Description copied from interface:DatabaseStructureIs the structure physically a sequence?- Specified by:
isPhysicalSequencein interfaceDatabaseStructure- Returns:
trueif the actual database structure is a sequence;falseotherwise.
-
getSourceIncrementSize
protected final int getSourceIncrementSize()
-
getQualifiedName
protected QualifiedName getQualifiedName()
-
buildSequence
protected void buildSequence(Database database)
-
-