Package org.hibernate.id.enhanced
Class SequenceStructure
java.lang.Object
org.hibernate.id.enhanced.SequenceStructure
- All Implemented Interfaces:
DatabaseStructure
Describes a sequence.
-
Constructor Summary
ConstructorsConstructorDescriptionSequenceStructure(Dialect dialect, String sequenceName, int initialValue, int incrementSize, Class numberType) -
Method Summary
Modifier and TypeMethodDescriptionbuildCallback(SessionImplementor session) A callback to be able to get the next value from the underlying structure as needed.intThe configured increment sizeintThe configured initial valuegetName()The name of the database structure (table or sequence).intHow many times has this structure been accessed through this reference?voidPrepare this structure for use.String[]sqlCreateStrings(Dialect dialect) Commands needed to create the underlying structures.String[]sqlDropStrings(Dialect dialect) Commands needed to drop the underlying structures.
-
Constructor Details
-
SequenceStructure
-
-
Method Details
-
getName
The name of the database structure (table or sequence).- Specified by:
getNamein interfaceDatabaseStructure- Returns:
- The structure name.
-
getIncrementSize
public int getIncrementSize()The configured increment size- Specified by:
getIncrementSizein interfaceDatabaseStructure- Returns:
- The configured increment size
-
getTimesAccessed
public int getTimesAccessed()How many times has this structure been accessed through this reference?- Specified by:
getTimesAccessedin interfaceDatabaseStructure- Returns:
- The number of accesses.
-
getInitialValue
public int getInitialValue()The configured initial value- Specified by:
getInitialValuein interfaceDatabaseStructure- Returns:
- The configured initial value
-
buildCallback
A 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.
-
prepare
Prepare this structure for use. Called sometime after instantiation, but before first use.- Specified by:
preparein interfaceDatabaseStructure- Parameters:
optimizer- The optimizer being applied to the generator.
-
sqlCreateStrings
Commands needed to create the underlying structures.- Specified by:
sqlCreateStringsin interfaceDatabaseStructure- Parameters:
dialect- The database dialect being used.- Returns:
- The creation commands.
- Throws:
HibernateException
-
sqlDropStrings
Commands needed to drop the underlying structures.- Specified by:
sqlDropStringsin interfaceDatabaseStructure- Parameters:
dialect- The database dialect being used.- Returns:
- The drop commands.
- Throws:
HibernateException
-