Package org.hibernate.id.enhanced
Interface DatabaseStructure
- All Superinterfaces:
ExportableProducer
- All Known Implementing Classes:
OrderedSequenceStructure,SequenceStructure,TableStructure
Encapsulates definition of the underlying data structure backing a
sequence-style generator.
-
Method Summary
Modifier and TypeMethodDescriptionA callback to be able to get the next value from the underlying structure as needed.default voidConfigures this structure with the given arguments.default String[]Deprecated.Exposed for tests only.intThe configured increment sizeintThe configured initial valueThe physical name of the database structure (table or sequence).intHow many times has this structure been accessed through this reference?default voidinitialize(SqlStringGenerationContext context) Initializes this structure, in particular pre-generates SQL as necessary.booleanIs the structure physically a sequence?default voidDeprecated.Useconfigure(Optimizer)instead.voidregisterExportables(Database database) Register database objects involved in this structure, e.g.
-
Method Details
-
getPhysicalName
QualifiedName getPhysicalName()The physical name of the database structure (table or sequence).Only available after
registerExportables(Database)has been called.- Returns:
- The structure name.
-
getTimesAccessed
int getTimesAccessed()How many times has this structure been accessed through this reference?- Returns:
- The number of accesses.
-
getInitialValue
int getInitialValue()The configured initial value- Returns:
- The configured initial value
-
getIncrementSize
int getIncrementSize()The configured increment size- Returns:
- The configured increment size
-
prepare
Deprecated.Useconfigure(Optimizer)instead.Prepare this structure for use. Called sometime after instantiation, but before first use.- Parameters:
optimizer- The optimizer being applied to the generator.
-
configure
Configures this structure with the given arguments.Called just after instantiation, before
initialize(SqlStringGenerationContext)- Parameters:
optimizer- The optimizer being applied to the generator.
-
registerExportables
Register database objects involved in this structure, e.g. sequences, tables, etc.This method is called just once, after
configure(Optimizer), but beforeinitialize(SqlStringGenerationContext).- Specified by:
registerExportablesin interfaceExportableProducer- Parameters:
database- The database instance
-
initialize
Initializes this structure, in particular pre-generates SQL as necessary.This method is called just once, after
registerExportables(Database), before first use.- Parameters:
context- A context to help generate SQL strings
-
isPhysicalSequence
boolean isPhysicalSequence()Is the structure physically a sequence?- Returns:
trueif the actual database structure is a sequence;falseotherwise.
-
getAllSqlForTests
Deprecated.Exposed for tests only.
-