Package org.hibernate.id.enhanced
Interface DatabaseStructure
-
- All Superinterfaces:
ExportableProducer
- All Known Implementing Classes:
OrderedSequenceStructure
,SequenceStructure
,TableStructure
public interface DatabaseStructure extends ExportableProducer
Encapsulates definition of the underlying data structure backing a sequence-style generator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AccessCallback
buildCallback(SharedSessionContractImplementor session)
A callback to be able to get the next value from the underlying structure as needed.int
getIncrementSize()
The configured increment sizeint
getInitialValue()
The configured initial valuejava.lang.String
getName()
The name of the database structure (table or sequence).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.java.lang.String[]
sqlCreateStrings(Dialect dialect)
Commands needed to create the underlying structures.java.lang.String[]
sqlDropStrings(Dialect dialect)
Commands needed to drop the underlying structures.-
Methods inherited from interface org.hibernate.boot.model.relational.ExportableProducer
registerExportables
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
The name of the database structure (table or sequence).- 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
-
buildCallback
AccessCallback buildCallback(SharedSessionContractImplementor session)
A callback to be able to get the next value from the underlying structure as needed.- Parameters:
session
- The session.- Returns:
- The next value.
-
prepare
void prepare(Optimizer optimizer)
Prepare this structure for use. Called sometime after instantiation, but before first use.- Parameters:
optimizer
- The optimizer being applied to the generator.
-
sqlCreateStrings
java.lang.String[] sqlCreateStrings(Dialect dialect)
Commands needed to create the underlying structures.- Parameters:
dialect
- The database dialect being used.- Returns:
- The creation commands.
-
sqlDropStrings
java.lang.String[] sqlDropStrings(Dialect dialect)
Commands needed to drop the underlying structures.- Parameters:
dialect
- The database dialect being used.- Returns:
- The drop commands.
-
isPhysicalSequence
boolean isPhysicalSequence()
Is the structure physically a sequence?- Returns:
true
if the actual database structure is a sequence;false
otherwise.
-
-