Package org.hibernate.id.enhanced
Class TableStructure
java.lang.Object
org.hibernate.id.enhanced.TableStructure
- All Implemented Interfaces:
ExportableProducer
,DatabaseStructure
Describes a table used to mimic sequence behavior
-
Constructor Summary
ConstructorsConstructorDescriptionTableStructure
(String contributor, QualifiedName qualifiedTableName, Identifier valueColumnNameIdentifier, int initialValue, int incrementSize, Class<?> numberType) TableStructure
(String contributor, QualifiedName qualifiedTableName, Identifier valueColumnNameIdentifier, int initialValue, int incrementSize, String options, Class<?> numberType) -
Method Summary
Modifier and TypeMethodDescriptionA callback to be able to get the next value from the underlying structure as needed.String[]
Deprecated.int
The configured increment sizeint
The configured initial valueThe physical name of the database structure (table or sequence).int
How many times has this structure been accessed through this reference?void
initialize
(SqlStringGenerationContext context) Initializes this structure, in particular pre-generates SQL as necessary.boolean
Is the structure physically a sequence?void
Deprecated.void
registerExportables
(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
configure
-
Constructor Details
-
TableStructure
public TableStructure(String contributor, QualifiedName qualifiedTableName, Identifier valueColumnNameIdentifier, int initialValue, int incrementSize, Class<?> numberType) -
TableStructure
public TableStructure(String contributor, QualifiedName qualifiedTableName, Identifier valueColumnNameIdentifier, int initialValue, int incrementSize, String options, Class<?> numberType)
-
-
Method Details
-
getPhysicalName
Description copied from interface:DatabaseStructure
The physical name of the database structure (table or sequence).Only available after
DatabaseStructure.registerExportables(Database)
has been called.- Specified by:
getPhysicalName
in interfaceDatabaseStructure
- Returns:
- The structure name.
-
getLogicalValueColumnNameIdentifier
-
getInitialValue
public int getInitialValue()Description copied from interface:DatabaseStructure
The configured initial value- Specified by:
getInitialValue
in interfaceDatabaseStructure
- Returns:
- The configured initial value
-
getIncrementSize
public int getIncrementSize()Description copied from interface:DatabaseStructure
The configured increment size- Specified by:
getIncrementSize
in interfaceDatabaseStructure
- Returns:
- The configured increment size
-
getTimesAccessed
public int getTimesAccessed()Description copied from interface:DatabaseStructure
How many times has this structure been accessed through this reference?- Specified by:
getTimesAccessed
in interfaceDatabaseStructure
- Returns:
- The number of accesses.
-
getAllSqlForTests
Deprecated.- Specified by:
getAllSqlForTests
in interfaceDatabaseStructure
-
prepare
Deprecated.Description copied from interface:DatabaseStructure
Prepare this structure for use. Called sometime after instantiation, but before first use.- Specified by:
prepare
in interfaceDatabaseStructure
- Parameters:
optimizer
- The optimizer being applied to the generator.
-
isPhysicalSequence
public boolean isPhysicalSequence()Description copied from interface:DatabaseStructure
Is the structure physically a sequence?- Specified by:
isPhysicalSequence
in interfaceDatabaseStructure
- Returns:
true
if the actual database structure is a sequence;false
otherwise.
-
registerExportables
Description copied from interface:DatabaseStructure
Register 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:
registerExportables
in interfaceDatabaseStructure
- Specified by:
registerExportables
in interfaceExportableProducer
- Parameters:
database
- The database instance
-
initialize
Description copied from interface:DatabaseStructure
Initializes this structure, in particular pre-generates SQL as necessary.This method is called just once, after
DatabaseStructure.registerExportables(Database)
, before first use.- Specified by:
initialize
in interfaceDatabaseStructure
- Parameters:
context
- A context to help generate SQL strings
-