Package org.hibernate.id.enhanced
Class TableStructure
java.lang.Object
org.hibernate.engine.TransactionHelper
org.hibernate.id.enhanced.TableStructure
- All Implemented Interfaces:
DatabaseStructure
Describes a table used to mimic sequence behavior
-
Constructor Summary
ConstructorsConstructorDescriptionTableStructure(Dialect dialect, String tableName, String valueColumnName, 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.protected SerializabledoWorkInCurrentTransaction(Connection conn, String sql) The work to be doneintThe 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.Methods inherited from class org.hibernate.engine.TransactionHelper
doWorkInNewTransaction
-
Constructor Details
-
TableStructure
-
-
Method Details
-
getName
The name of the database structure (table or sequence).- Specified by:
getNamein interfaceDatabaseStructure- Returns:
- The structure name.
-
getInitialValue
public int getInitialValue()The configured initial value- Specified by:
getInitialValuein interfaceDatabaseStructure- Returns:
- The configured initial value
-
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.
-
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.
-
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.
-
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
-
doWorkInCurrentTransaction
The work to be done- Specified by:
doWorkInCurrentTransactionin classTransactionHelper- Throws:
SQLException
-