Class SequenceStyleGenerator

java.lang.Object
org.hibernate.id.enhanced.SequenceStyleGenerator
All Implemented Interfaces:
Serializable, ExportableProducer, BeforeExecutionGenerator, Generator, BulkInsertionCapableIdentifierGenerator, Configurable, StandardGenerator, IdentifierGenerator, OptimizableGenerator, PersistentIdentifierGenerator
Direct Known Subclasses:
OrderedSequenceGenerator

public class SequenceStyleGenerator extends Object implements PersistentIdentifierGenerator, BulkInsertionCapableIdentifierGenerator
Generates identifier values based on a sequence-style database structure. Variations range from actually using a sequence to using a table to mimic a sequence. These variations are encapsulated by the DatabaseStructure interface internally.

General configuration parameters
Parameter name Default value Interpretation
"sequence_name" The name of the sequence/table to use to store/retrieve values
"initial_value" 1 The initial value to be stored for the given segment; the effect in terms of storage varies based on Optimizer and DatabaseStructure
"increment_size" 50 The increment size for the underlying segment; the effect in terms of storage varies based on Optimizer and DatabaseStructure
"optimizer" depends on defined increment size Allows explicit definition of which optimization strategy to use
"force_table_use" false Allows explicit definition of which optimization strategy to use

Configuration parameters used specifically when the underlying structure is a table:

Table configuration parameters
Parameter name Default value Interpretation
"value_column" "next_val" The name of column which holds the sequence value for the given segment
Author:
Steve Ebersole, Lukasz Antoniak
See Also: